diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c71190ce39..08c14747e5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -23,14 +23,14 @@ All good? Then proceed and fill out the items below. **Mods (complete and add to the following information):** - **Arma 3:** `x.xx` [e.g. 1.00 stable, rc, dev] - **CBA:** `3.x.x` [e.g. 3.0.0 stable, commit hash] -- **ACE3:** `3.x.x` [eg. 3.0.0 stable, commit hash] +- **ACE3:** `3.x.x` [e.g. 3.0.0 stable, commit hash] **Description:** A clear and concise description of what the bug is. **Steps to reproduce:** -_Follow [https://ace3.acemod.org/img/wiki/user/issue_flowchart.webp](this flowchart)!_ +_Follow [this flowchart](https://ace3.acemod.org/img/wiki/user/issue_flowchart.webp)!_ 1. _Go to ..._ 2. _Click ..._ diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 2ba4cbfcaf..778d34fd9f 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -11,11 +11,10 @@ sort-direction: ascending categories: - title: '**ADDED:**' labels: - - 'kind/feature request' - - 'kind/added feature' + - 'kind/feature' - title: '**FIXED:**' labels: - - 'kind/bug fix' + - 'kind/bug-fix' - title: '**IMPROVED:**' labels: - 'kind/enhancement' @@ -23,17 +22,16 @@ categories: - title: '**CHANGED:**' labels: - 'kind/cleanup' - - 'area/compatibility' - 'kind/change' - title: '**SETTINGS:**' labels: - 'kind/setting' - title: '**TRANSLATIONS:**' labels: - - 'area/translations' + - 'kind/translation' exclude-labels: - - 'ignore changelog' + - 'ignore-changelog' - 'dependencies' change-template: '- $TITLE (#$NUMBER)' diff --git a/.github/workflows/arma.yml b/.github/workflows/arma.yml index da5fa29835..d0649a0ade 100644 --- a/.github/workflows/arma.yml +++ b/.github/workflows/arma.yml @@ -48,7 +48,7 @@ jobs: - name: Rename build folder run: mv .hemttout/build .hemttout/@ace - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ace3-${{ github.sha }}-nobin path: .hemttout/@* diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4140138f1e..cc6aba0a99 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -47,7 +47,7 @@ jobs: destination: docs/_site/ - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: jekyll-site path: docs/_site/ @@ -63,7 +63,7 @@ jobs: steps: - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jekyll-site path: _site/ diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml index 84ea189cca..9693d2df22 100644 --- a/.github/workflows/extensions.yml +++ b/.github/workflows/extensions.yml @@ -23,7 +23,7 @@ jobs: cd build cmake .. && cmake --build . - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ace3_extensions-${{ matrix.os }}-debug path: extensions/build diff --git a/.github/workflows/hemtt.yml b/.github/workflows/hemtt.yml index ffe8894986..e606852285 100644 --- a/.github/workflows/hemtt.yml +++ b/.github/workflows/hemtt.yml @@ -38,7 +38,7 @@ jobs: - name: Rename build folder run: mv .hemttout/build .hemttout/@ace - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ace3-${{ github.sha }} path: .hemttout/@* diff --git a/.github/workflows/pboproject.yml b/.github/workflows/pboproject.yml index be578c0e27..71e36eb12b 100644 --- a/.github/workflows/pboproject.yml +++ b/.github/workflows/pboproject.yml @@ -67,18 +67,19 @@ jobs: xcopy /e /h /q z\ace\tools\pDummies\gm gm\ xcopy /e /h /q z\ace\tools\pDummies\vn vn\ xcopy /e /h /q z\ace\tools\pDummies\WW2 WW2\ + xcopy /e /h /q z\ace\tools\pDummies\CUP CUP\ - name: Build run: py P:\z\ace\tools\make.py ci env: PYTHONUNBUFFERED: 1 - name: Archive logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() }} with: name: logs path: temp/*.log - name: Archive @ace - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: '@ace3-${{ github.sha }}' path: z\ace\release\@ace diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index fa0dbe292a..2130398964 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -11,6 +11,6 @@ jobs: steps: - name: Release Drafter if: github.repository == 'acemod/ACE3' - uses: release-drafter/release-drafter@v5 + uses: release-drafter/release-drafter@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 8a7e6945a6..4ad0a5e1eb 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ CHANGELOG.md sqfvm.exe ArmaScriptCompiler.exe *.sqfc +!extras/**/*.zip diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 206bf9573c..f5ed361e3e 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -28,7 +28,7 @@ exclude = [ "zeus/functions/fnc_zeusAttributes.sqf", ] -[hemtt.launch] +[hemtt.launch.default] workshop = [ "450814997", # CBA_A3 ] diff --git a/AUTHORS.txt b/AUTHORS.txt index bcc4a5d40e..27dad9464e 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -6,6 +6,7 @@ # request, preferably including an email address. # CORE TEAM +BaerMitUmlaut Brett Mayson bux578 commy2 @@ -25,6 +26,7 @@ Kieran kymckay mharis001 MikeMF +MiszczuZPolski NouberNou PabstMirror Ruthberg @@ -56,7 +58,6 @@ Arcanum417 Arkhir ARV187 aka Spark23 Asgar Serran -BaerMitUmlaut Bamse Barman75 Bla1337 @@ -126,6 +127,7 @@ Keithen Kllrt KokaKolaA3 Krzyciu +LAxemann legman Legolasindar "Viper" licht-im-Norden87 @@ -190,3 +192,4 @@ YetheSamartaka xrufix Zakant zGuba +Zman6258 diff --git a/README.md b/README.md index b461bfe520..feb9194d65 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- ACE3 Version + ACE3 Version ACE3 Issues diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index e6417f9a02..9d0dd0ee4b 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -1,7 +1,5 @@ #include "script_component.hpp" -#include "initKeybinds.inc.sqf" - GVAR(currentbulletID) = -1; GVAR(Protractor) = false; @@ -11,6 +9,8 @@ GVAR(currentGrid) = 0; if (!hasInterface) exitWith {}; +#include "initKeybinds.inc.sqf" + ["CBA_settingsInitialized", { //If not enabled, dont't add PFEH if (!GVAR(enabled)) exitWith {}; @@ -19,11 +19,11 @@ if (!hasInterface) exitWith {}; [] call FUNC(initializeTerrainExtension); // Register fire event handler - ["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; - ["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; // Register Perframe Handler - [FUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler; //Add warnings for missing compat PBOs (only if AB is on) { diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index a167d027f3..b41fd7a7c0 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -17,7 +17,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!alive _projectile) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 6af9efca24..89e89b9f7e 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -22,7 +22,7 @@ private _initStartTime = diag_tickTime; private _mapSize = worldSize; if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { - INFO_1("Terrain already initialized [world: %1]", worldName); + INFO_1("Terrain already initialized [world: %1]",worldName); #ifdef DEBUG_MODE_FULL systemChat "AdvancedBallistics: Terrain already initialized"; #endif @@ -33,14 +33,14 @@ private _gridCells = _mapGrids * _mapGrids; GVAR(currentGrid) = 0; -INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldName); +INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName); [{ params ["_args","_idPFH"]; _args params ["_mapGrids", "_gridCells", "_initStartTime"]; if (GVAR(currentGrid) >= _gridCells) exitWith { - INFO_2("Finished terrain initialization in %1 seconds [world: %2]", (diag_tickTime - _initStartTime) toFixed 2, worldName); + INFO_2("Finished terrain initialization in %1 seconds [world: %2]",(diag_tickTime - _initStartTime) toFixed 2,worldName); #ifdef DEBUG_MODE_FULL systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2]; #endif @@ -53,7 +53,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa private _gridCenter = [_x + 25, _y + 25]; private _gridHeight = round(getTerrainHeightASL _gridCenter); private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); - private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0}; + private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter); "ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater]; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 103ce3d1cd..125c3677b8 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -44,6 +44,9 @@ if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { _dragModel = 1; }; private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients"); +if (_ballisticCoefficients isEqualTo []) then { + _ballisticCoefficients = [0.5]; +}; private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries"); private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere"); if (_atmosphereModel isEqualTo "") then { @@ -66,7 +69,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then { if (_inheritedBarrelConfig || _inheritedTempConfig) then { private _parentConfig = inheritsFrom _ammoConfig; private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed"); - WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed); + WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig,_parentSpeed); if (_parentSpeed <= 0) exitWith {//Handle weird or null parent _muzzleVelocityTable = []; _ammoTempMuzzleVelocityShifts = []; diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index bf0e23f97c..c79aeaf2ea 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -21,7 +21,7 @@ private _weaponConfig = (configFile >> "CfgWeapons" >> _this); private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist"); -private _twistDirection = [0, 1] select (_barrelTwist != 0); +private _twistDirection = parseNumber (_barrelTwist != 0); if (isNumber (_weaponConfig >> "ACE_twistDirection")) then { _twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection"); if !(_twistDirection in [-1, 0, 1]) then { diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index 57b57dcf22..f5aa7432f0 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -2,35 +2,6 @@ if (!hasInterface) exitWith {}; -["baseline", { - private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0]; - switch (stance ACE_player) do { - case ("CROUCH"): { - (1.0 + _fatigue ^ 2 * 0.1) - }; - case ("PRONE"): { - (1.0 + _fatigue ^ 2 * 2.0) - }; - default { - (1.5 + _fatigue ^ 2 * 3.0) - }; - }; -}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor); - -["multiplier", { - switch (true) do { - case (isWeaponRested ACE_player): { - GVAR(swayFactor) * GVAR(restedSwayFactor) - }; - case (isWeaponDeployed ACE_player): { - GVAR(swayFactor) * GVAR(deployedSwayFactor) - }; - default { - GVAR(swayFactor) - }; - }; -}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor); - // recheck weapon inertia after weapon swap, change of attachments or switching unit ["weapon", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler; ["loadout", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler; @@ -39,6 +10,21 @@ if (!hasInterface) exitWith {}; ["CBA_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; + ["baseline", { + private _fatigue = ACE_player getVariable [QGVAR(aimFatigue), 0]; + switch (stance ACE_player) do { + case ("CROUCH"): { + (1.0 + _fatigue ^ 2 * 0.1) + }; + case ("PRONE"): { + (1.0 + _fatigue ^ 2 * 2.0) + }; + default { + (1.5 + _fatigue ^ 2 * 3.0) + }; + }; + }, QUOTE(ADDON)] call EFUNC(common,addSwayFactor); + // - Post process effect ------------------------------------------------------ GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220]; GVAR(ppeBlackout) ppEffectEnable true; @@ -60,7 +46,7 @@ if (!hasInterface) exitWith {}; }, true] call CBA_fnc_addPlayerEventHandler; // - Duty factors ------------------------------------------------------------- - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + if (GVAR(medicalLoaded)) then { [QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1 linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true]; }] call FUNC(addDutyFactor); diff --git a/addons/advanced_fatigue/XEH_preInit.sqf b/addons/advanced_fatigue/XEH_preInit.sqf index 643b7b0be0..9f58e44fdf 100644 --- a/addons/advanced_fatigue/XEH_preInit.sqf +++ b/addons/advanced_fatigue/XEH_preInit.sqf @@ -13,5 +13,6 @@ GVAR(dutyList) = createHashMap; GVAR(setAnimExclusions) = []; GVAR(inertia) = 0; GVAR(inertiaCache) = createHashMap; +GVAR(medicalLoaded) = ["ace_medical"] call EFUNC(common,isModLoaded); ADDON = true; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index 8903bab495..da469b6d21 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -23,6 +23,12 @@ if (!alive ACE_player) exitWith { _staminaBarContainer ctrlCommit 1; }; + +private _oxygen = 0.9; // Default AF oxygen saturation +if (GVAR(medicalLoaded) && {EGVAR(medical_vitals,simulateSpo2)}) then { + _oxygen = (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100; +}; + private _currentWork = REE; private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6; @@ -42,8 +48,8 @@ GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3. private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage)); // Calculate available power -private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt; -private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt; +private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleIntegritySqrt; +private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleIntegritySqrt; // Calculate how much power is consumed from each reserve private _ae1Power = _currentWork min _ae1PathwayPowerFatigued; @@ -58,8 +64,8 @@ GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP; GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1; // Aerobic ATP reserve recovery -GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + OXYGEN * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0; -GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + OXYGEN * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0; +GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + _oxygen * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0; +GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + _oxygen * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0; // Anaerobic ATP reserver and fatigue recovery GVAR(anReserve) = ((GVAR(anReserve) @@ -70,9 +76,9 @@ GVAR(anFatigue) = ((GVAR(anFatigue) - (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor) ) min 1) max 0; -private _aeReservePercentage = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2; -private _anReservePercentage = GVAR(anReserve) / AN_MAXRESERVE; -private _perceivedFatigue = 1 - (_anReservePercentage min _aeReservePercentage); +GVAR(aeReservePercentage) = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2; +GVAR(anReservePercentage) = GVAR(anReserve) / AN_MAXRESERVE; +private _perceivedFatigue = 1 - (GVAR(anReservePercentage) min GVAR(aeReservePercentage)); [ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects); diff --git a/addons/advanced_fatigue/initSettings.inc.sqf b/addons/advanced_fatigue/initSettings.inc.sqf index e2d797bf91..9952a51d23 100644 --- a/addons/advanced_fatigue/initSettings.inc.sqf +++ b/addons/advanced_fatigue/initSettings.inc.sqf @@ -80,30 +80,3 @@ [0, 5, 1, 1], true ] call CBA_fnc_addSetting; - -[ - QGVAR(swayFactor), - "SLIDER", - [LSTRING(SwayFactor), LSTRING(SwayFactor_Description)], - LSTRING(DisplayName), - [0, 5, 1, 1], - true -] call CBA_fnc_addSetting; - -[ - QGVAR(restedSwayFactor), - "SLIDER", - [LSTRING(RestedSwayFactor), LSTRING(RestedSwayFactor_Description)], - LSTRING(DisplayName), - [0, 5, 1, 2], - true -] call CBA_fnc_addSetting; - -[ - QGVAR(deployedSwayFactor), - "SLIDER", - [LSTRING(DeployedSwayFactor), LSTRING(DeployedSwayFactor_Description)], - LSTRING(DisplayName), - [0, 5, 1, 2], - true -] call CBA_fnc_addSetting; diff --git a/addons/advanced_fatigue/stringtable.xml b/addons/advanced_fatigue/stringtable.xml index dc68259db8..5cd36ffce6 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -44,7 +44,7 @@ Influenza la prestazione generale di tutti i giocatori smuniti di un fattore personalizzato. Maggiore significa migliore. 影響所有玩家的體力表現,值越高代表體力越好 影响所有玩家的体力表现,值越高代表体力越好 - Влияет на общую производительность игроков, у которых не задано персональное значение. + Влияет на общую производительность игроков, у которых не задано персональное значение. Чем выше, тем лучше. Influencia na performance geral de todos os jogadores sem nenhum fator personalizado. Quanto maior, melhor. Ovlivňuje celkový výkon všech hráčů bez vlastního faktoru. Vyšší znamená lépe. @@ -59,7 +59,7 @@ Influenza la prestazione personalizzata di questa unità. Maggiore significa migliore. 影響這個單位的體力表現,值越高代表體力越好 影响这个单位的体力表现,值越高代表体力越好 - Влияет на общую производительность юнита. + Влияет на общую производительность юнита.Чем выше, тем лучше. Influencia na performance geral dessa unidade. Quanto maior, melhor. Ovlivňuje celkový výkon této jednotky. Vyšší znamená lépe. @@ -154,72 +154,6 @@ Define o quanto que um terreno íngrime aumenta na perda de estamina. Quanto maior, maior a perda de estamina. Nastavuje, o kolik strmý terén zvyšuje ztrátu výdrže. Vyšší znamená vyšší ztrátu výdrže. - - Sway factor - Factor de balanceo de mira - Verwacklungsfaktor - 手ぶれ因数 - 抖动系数 - 抖動因素 - Facteur de tremblement - Fattore di Oscillazione - Czynnik kołysania - Фактор колебания прицела - Fator de Balanço de Mira - Faktor kývání - 손떨림 정도 - - - Influences the amount of weapon sway. Higher means more sway. - Afecta al la estabilidad de la mira. Más alto significa más balanceo - Beeinflusst, wie ruhig man eine Waffe halten kann. Ein höherer Wert bedeutet weniger Stabilisierung. - 武器の手ぶれの量に影響します。値が高いほど、手ぶれが強くなります。 - 影响手持武器的晃动程度,数值越高,抖动的越厉害。 - 影響手持武器晃動程度,數值越高抖動越厲害 - Influe sur l'amplitude du tremblement de l'arme. Une valeur plus élevée signifie plus de tremblement. - Influenza l'aumento di oscillazione dell'arma quando affaticato. Maggiore significa più oscillazione. - Wpływa na poziom kołysania broni. Większa ilość znaczy większe kołysanie. - Влияет на колебания прицела оружия. Чем выше - тем больше. - Influencia a quantidade de balanço da mira da arma. Quanto maior, mais balanço. - Ovlivňuje množství kývání zbraní. Vyšší znamená více kývání. - 손떨림의 정도를 정합니다. 높을 수록 많이 휘적입니다. - - - Rested sway factor - Facteur de balancement au repos - 휴식 시 손떨림 정도 - Fator de balanço de mira em repouso - Verwacklungsfaktor, wenn aufgelegt - Fattore di Oscillazione Appoggiato - 静止時の手ぶれ係数 - - - Influences the amount of weapon sway while weapon is rested. - Influence le degré de balancement de l'arme au repos. - 무기가 아무런 행동도 하지 않는 동안 무기가 흔들리는 정도를 정합니다. - Influencia a quantidade de balanço de mira enquanto a arma está em repouso. - Beeinflusst, wie ruhig man die Waffe hält, während sie aufgelegt ist. - Determina la quantità di oscillazione dell'arma quando questa è appoggiata. - 静止している時の武器の手ぶれの量に影響します。 - - - Deployed sway factor - Facteur de balancement déployé - 거치 시 손떨림 정도 - Fator de balanço de mira em posição de tiro - Verwacklungsfaktor, wenn Zweibein aufgestellt ist. - Fattore di Oscillazione su Bipode - 展開時の手ぶれ係数 - - - Influences the amount of weapon sway while weapon is deployed. - Influence le degré de balancement de l'arme déployée. - 무기를 거치하는 동안 무기를 흔드는 정도를 정합니다. - Influencia a quantidade de balanço de mira enquanto a arma está em posição de tiro. - Beeinflusst, wie ruhig man die Waffen hält, während das Zweibein aufgestellt ist. - Determina la quantità di oscillazione dell'arma quando questa è stabilizzata usando il bipode. - 武器の展開(Cキー)時の武器の手ぶれの量に影響します。 - Enabled Activada @@ -246,7 +180,7 @@ Abilita/Disabilita la Fatica Avanzata. 啟用/關閉進階體力. 启用/关闭进阶体力。 - Включает / Отключает Продвинутую усталость + Включает/отключает Продвинутую усталость Ativa/Desativa Fadiga Avançada. Aktivuje / deaktivuje Pokročilou únavu. diff --git a/addons/advanced_throwing/XEH_postInit.sqf b/addons/advanced_throwing/XEH_postInit.sqf index 96b0fbb09b..774c99b3e6 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -2,20 +2,22 @@ // Fired XEH GVAR(ammoEventHandlers) = createHashMap; -[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler; +[QGVAR(throwFiredXEH), LINKFUNC(throwFiredXEH)] call CBA_fnc_addEventHandler; // Exit on HC if (!hasInterface) exitWith {}; +// Temporary Wind Info indication +GVAR(tempWindInfo) = false; + // Ammo/Magazines look-up hash for correctness of initSpeed GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; { { private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); if (_ammo != "") then { GVAR(ammoMagLookup) setVariable [_ammo, _x]; }; - } count (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")); - nil -} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); + } forEach (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")); +} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); // Add keybinds diff --git a/addons/advanced_throwing/functions/fnc_canThrow.sqf b/addons/advanced_throwing/functions/fnc_canThrow.sqf index 06cf166f88..8b2987eafa 100644 --- a/addons/advanced_throwing/functions/fnc_canThrow.sqf +++ b/addons/advanced_throwing/functions/fnc_canThrow.sqf @@ -19,7 +19,7 @@ params ["_unit"]; if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false}; -if (vehicle _unit != _unit) exitWith { +if (!isNull objectParent _unit) exitWith { private _startPos = eyePos _unit; private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]); private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false]; diff --git a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf index 744a6d7aae..3b88564eae 100644 --- a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf +++ b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf @@ -53,6 +53,12 @@ _unit setVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]; // Remove controls hint (check if ever enabled is inside the function) call EFUNC(interaction,hideMouseHint); +// Hide wind info after throw, if it was temporarily enabled for the throw +if (GVAR(tempWindInfo)) then { + EGVAR(weather,WindInfo) = false; + GVAR(tempWindInfo) = false; +}; + // Remove throw action [_unit, "DefaultAction", _unit getVariable [QGVAR(throwAction), -1]] call EFUNC(common,removeActionEventHandler); diff --git a/addons/advanced_throwing/functions/fnc_getMuzzle.sqf b/addons/advanced_throwing/functions/fnc_getMuzzle.sqf index e0c55daba6..eab95825e4 100644 --- a/addons/advanced_throwing/functions/fnc_getMuzzle.sqf +++ b/addons/advanced_throwing/functions/fnc_getMuzzle.sqf @@ -17,9 +17,9 @@ params ["_magazineClassname"]; -_magazineClassname = toLower _magazineClassname; +_magazineClassname = toLowerANSI _magazineClassname; private _throwMuzzles = getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); -_throwMuzzles = _throwMuzzles select {_magazineClassname in ((getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")) apply {toLower _x})}; +_throwMuzzles = _throwMuzzles select {_magazineClassname in ((getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")) apply {toLowerANSI _x})}; [_throwMuzzles select 0, ""] select (_throwMuzzles isEqualTo []) diff --git a/addons/advanced_throwing/functions/fnc_prepare.sqf b/addons/advanced_throwing/functions/fnc_prepare.sqf index 070870879b..7926c2c864 100644 --- a/addons/advanced_throwing/functions/fnc_prepare.sqf +++ b/addons/advanced_throwing/functions/fnc_prepare.sqf @@ -18,6 +18,15 @@ params ["_unit"]; TRACE_1("params",_unit); +// Temporarily enable wind info, to aid in throwing smoke grenades effectively +if ( + GVAR(enableTempWindInfo) && + {!(missionNamespace getVariable [QEGVAR(weather,WindInfo), false])} +) then { + [] call EFUNC(weather,displayWindInfo); + GVAR(tempWindInfo) = true; +}; + // Select next throwable if one already in hand if (_unit getVariable [QGVAR(inHand), false]) exitWith { TRACE_1("inHand",_unit); diff --git a/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf b/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf index 15cae41585..d45f2add93 100644 --- a/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf +++ b/addons/advanced_throwing/functions/fnc_renderPickUpInteraction.sqf @@ -44,8 +44,7 @@ _addedPickUpHelpers pushBack _pickUpHelper; _throwablesHelped pushBack _x; }; - nil - } count _nearThrowables; + } forEach _nearThrowables; _args set [0, getPosASL ACE_player]; _args set [3, _nearThrowables]; @@ -56,11 +55,10 @@ { // Only handling with attachTo works nicely _x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]]; - nil - } count _addedPickUpHelpers; + } forEach _addedPickUpHelpers; } else { TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers); - {deleteVehicle _x} count _addedPickUpHelpers; + {deleteVehicle _x} forEach _addedPickUpHelpers; [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/advanced_throwing/functions/fnc_throw.sqf b/addons/advanced_throwing/functions/fnc_throw.sqf index 0380d3d896..797f18d773 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -45,7 +45,7 @@ if (!(_unit getVariable [QGVAR(primed), false])) then { private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity; // Adjust for throwing from inside vehicles, where we have a vehicle-based velocity that can't be compensated for by a human - if (vehicle _unit != _unit) then { + if (!isNull objectParent _unit) then { _newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit)); }; diff --git a/addons/advanced_throwing/initSettings.inc.sqf b/addons/advanced_throwing/initSettings.inc.sqf index d4ebe14918..d8396637c5 100644 --- a/addons/advanced_throwing/initSettings.inc.sqf +++ b/addons/advanced_throwing/initSettings.inc.sqf @@ -40,3 +40,11 @@ private _category = format ["ACE %1", localize LSTRING(Category)]; true, 1 ] call CBA_fnc_addSetting; + +[ + QGVAR(enableTempWindInfo), "CHECKBOX", + [LSTRING(EnableTempWindInfo_DisplayName), LSTRING(EnableTempWindInfo_Description)], + _category, + true, + 0 +] call CBA_fnc_addSetting; diff --git a/addons/advanced_throwing/stringtable.xml b/addons/advanced_throwing/stringtable.xml index ec2354a2c0..1e0b5ae23f 100644 --- a/addons/advanced_throwing/stringtable.xml +++ b/addons/advanced_throwing/stringtable.xml @@ -185,6 +185,24 @@ Permite que arremessáveis fixados em objetos sejam pegos. Zapíná schopnost zvednutí předmětů z objektů ke kterým jsou připnuté. + + Show Temporary Wind Info + Zeige temporäre Windinformationen + Mostra informazioni sul vento temporaneamente + 一時的に風の情報を表示 + 바람 정보 임시로 표시 + Afficher temporairement les informations sur le vent + Временно показать информацию о ветре + + + Temporarily display Wind Info while throwing, to aid in placing smoke grenades effectively. + Zeige während des werfens Windinformationen an, um Rauchgranaten effektiver zu platzieren. + Mostra le informazioni sul vento durante il lancio di granate, facilitando il piazzamento ottimale di fumogeni. + 投擲行動中に風向きの情報を一時的に表示し、発煙手榴弾の煙幕を効果的に展開しやすくします。 + 연막탄을 효과적으로 배치하는 데 도움이 되도록 투척하는 동안 일시적으로 바람 정보를 표시합니다. + Affiche les informations sur le vent pendant le lancement pour placer les grenades fumigènes plus efficacement. + Временно отображайте информацию о ветре во время броска, чтобы помочь эффективно разместить дымовые шашки. + Prepare/Change Throwable Preparar/Cambiar objetos lanzables diff --git a/addons/ai/XEH_postInit.sqf b/addons/ai/XEH_postInit.sqf index fce5152e3d..7c4f79f8fb 100644 --- a/addons/ai/XEH_postInit.sqf +++ b/addons/ai/XEH_postInit.sqf @@ -16,7 +16,7 @@ } forEach _sections; }] call CBA_fnc_addEventHandler; -[QGVAR(unGarrison), FUNC(unGarrison)] call CBA_fnc_addEventHandler; +[QGVAR(unGarrison), LINKFUNC(unGarrison)] call CBA_fnc_addEventHandler; [QGVAR(doMove), { params ["_unitsArray"]; @@ -73,6 +73,6 @@ if (isServer) then { ["CAManBase", "init", { // wait for HMD to be assigned so `hmd _unit` works - [FUNC(assignNVG), _this, 1] call CBA_fnc_waitAndExecute; + [LINKFUNC(assignNVG), _this, 1] call CBA_fnc_waitAndExecute; }] call CBA_fnc_addClassEventHandler; }; diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index ead982d951..4b8f84fce6 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -7,8 +7,8 @@ * 0: The building(s) nearest this position are used * 1: Limit the building search to those type of building * 2: Units that will be garrisoned - * 3: Radius to fill building(s) (default: 50) - * 4: 0: even filling, 1: building by building, 2: random filling (default: 0) + * 3: Radius to fill building(s) (default: 50) + * 4: 0: even filling, 1: building by building, 2: random filling (default: 0) * 5: True to fill building(s) from top to bottom (default: false) (note: only works with filling mode 0 and 1) * 6: Teleport units (default: false) @@ -33,7 +33,7 @@ if (_startingPos isEqualTo [0,0,0]) exitWith { [LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured); }; -if (count _unitsArray == 0 || {isNull (_unitsArray select 0)}) exitWith { +if (_unitsArray isEqualTo [] || {isNull (_unitsArray select 0)}) exitWith { TRACE_1("fnc_garrison: Units error",_unitsArray); [LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured); }; @@ -43,7 +43,7 @@ if (_fillingRadius >= 50) then { _buildings = [_buildings] call CBA_fnc_shuffle; }; -if (count _buildings == 0) exitWith { +if (_buildings isEqualTo []) exitWith { TRACE_1("fnc_garrison: Building error",_buildings); [LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured); }; @@ -128,7 +128,7 @@ switch (_fillingType) do { } else { private _pos = _building select 0; private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); - LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); @@ -177,7 +177,7 @@ switch (_fillingType) do { } else { private _pos = _building select 0; private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); - LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); @@ -224,7 +224,7 @@ switch (_fillingType) do { } else { private _pos = selectRandom _building; private _nearestUnits = (_pos nearEntities ["CAManBase", 2]); - LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); + LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]); if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then { LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]); @@ -258,7 +258,7 @@ switch (_fillingType) do { }; }; -TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport); +TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)],_teleport); // Update the unit list and remove duplicate positions and units private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; @@ -279,5 +279,5 @@ if (_teleport) then { [_unitMoveList] call FUNC(garrisonMove); }; -TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray); +TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left",count _unitsArray,count _buildingsIndex)],_unitsArray); _unitsArray diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf index 588ebb2016..4d1c471a0e 100644 --- a/addons/ai/functions/fnc_garrisonMove.sqf +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -81,13 +81,13 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { [QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent; }; - LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]); + LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left",count _unitMoveList)]); }; // Check if unit is alive or even existing if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then { _unitMoveList deleteAt (_unitMoveList find _x); - LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left", count _unitMoveList)]); + LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left",count _unitMoveList)]); } else { private _unitPos = getPos _unit; diff --git a/addons/ai/functions/fnc_unGarrison.sqf b/addons/ai/functions/fnc_unGarrison.sqf index ab0c525a24..09ebc3e63d 100644 --- a/addons/ai/functions/fnc_unGarrison.sqf +++ b/addons/ai/functions/fnc_unGarrison.sqf @@ -28,7 +28,7 @@ _units = _units select {local _x}; private _leader = leader _unit; - TRACE_3("fnc_ungarrison: unit and leader",_unit , _leader, (_leader == _unit)); + TRACE_3("fnc_ungarrison: unit and leader",_unit,_leader,(_leader == _unit)); _unit setVariable [QGVAR(garrisonned), false, true]; diff --git a/addons/ai/stringtable.xml b/addons/ai/stringtable.xml index 12c9c8d73f..11a686f6b2 100644 --- a/addons/ai/stringtable.xml +++ b/addons/ai/stringtable.xml @@ -90,6 +90,7 @@ Equipement JVN automatique Equipar NVGs automaticamente 暗視装置の自動装備 + Автоматическое оснащение ПНВ Equips NVG in inventory during night time and unequips it during day time.\nDoes not add NVGs to inventory! @@ -100,6 +101,7 @@ Equipe des JVN pendant la nuit et les déséquipe le jour.\nN'ajoute pas les JVN dans l'intenvaire ! Equipa o NVG do inventário durante a noite e desequipa durante o dia.\nNão adiciona NVGs ao inventário! インベントリ内の暗視装置を夜間に装備し、日中は解除し収納します。\nこれはNVGをインベントリに追加しません。 + Экипирует ПНВ в ночное время и отключает его в дневное время.\nНе добавляет ПНВ в инвентарь! diff --git a/addons/aircraft/functions/fnc_canShowEject.sqf b/addons/aircraft/functions/fnc_canShowEject.sqf index 08c55eb781..9239c413a7 100644 --- a/addons/aircraft/functions/fnc_canShowEject.sqf +++ b/addons/aircraft/functions/fnc_canShowEject.sqf @@ -30,6 +30,6 @@ _vehicle == vehicle _unit if (_unit == _x select FULLCREW_UNIT) exitWith { _ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH]; }; - } count fullCrew _vehicle; + } forEach fullCrew _vehicle; _vehicle getVariable [_ejectVarName, false] } diff --git a/addons/aircraft/functions/fnc_droneModifyWaypoint.sqf b/addons/aircraft/functions/fnc_droneModifyWaypoint.sqf index 868a0d0f8b..b85e556587 100644 --- a/addons/aircraft/functions/fnc_droneModifyWaypoint.sqf +++ b/addons/aircraft/functions/fnc_droneModifyWaypoint.sqf @@ -17,13 +17,13 @@ * * Public: No */ - + params ["_vehicle", "_group", "_type", "_value"]; TRACE_4("droneModifyWaypoint",_vehicle,_group,_type,_value); private _index = (currentWaypoint _group) min count waypoints _group; private _waypoint = [_group, _index]; -switch (toLower _type) do { +switch (toLowerANSI _type) do { case ("height"): { private _pos = waypointPosition _waypoint; _pos set [2, _value]; diff --git a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf index 5c919564ce..5ffbbae825 100644 --- a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf +++ b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf @@ -29,7 +29,10 @@ private _currentLoiterRadius = waypointLoiterRadius _waypoint; private _currentLoiterType = waypointLoiterType _waypoint; // Set pos to ATL -_pos set [2, if (_currentHeight >= 50) then { _currentHeight } else { 0 }]; +_pos set [ + 2, + [0, _currentHeight] select (_currentHeight >= 50) +]; // [_group] call CBA_fnc_clearWaypoints; _waypoint = _group addWaypoint [_pos, 0]; diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index 97b08ed3e2..c0cef87756 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -29,7 +29,7 @@ Открыть грузовой отсек Apri la rampa di carico Abrir porta de carga - カーゴ ドアを開く + 貨物室ドアを 開く 화물칸 개방 開啟貨艙門 开启货舱门 @@ -46,7 +46,7 @@ Закрыть грузовой отсек Chiudi la rampa di carico Fechar porta de carga - カーゴ ドアを閉じる + 貨物室ドアを 閉じる 화물칸 폐쇄 關閉貨艙門 关闭货舱门 diff --git a/addons/arsenal/ACE_Arsenal_Stats.hpp b/addons/arsenal/ACE_Arsenal_Stats.hpp index 7748d1bdc5..0856685447 100644 --- a/addons/arsenal/ACE_Arsenal_Stats.hpp +++ b/addons/arsenal/ACE_Arsenal_Stats.hpp @@ -123,7 +123,9 @@ class GVAR(stats) { stats[] = {"maximumLoad"}; displayName = "$STR_a3_rscdisplayarsenal_stat_load"; showBar = 1; + showText = 1; barStatement = QUOTE([ARR_3((_this select 0) select 0,_this select 1,[ARR_3([ARR_2(0,500)],[ARR_2(0.01,1)],false)])] call FUNC(statBarStatement_default)); + textStatement = QUOTE(call FUNC(statTextStatement_load)); tabs[] = {{3,4,5}, {}}; }; class ACE_smokeChemTTL: statBase { diff --git a/addons/arsenal/Cfg3DEN.hpp b/addons/arsenal/Cfg3DEN.hpp index f119af364b..1cec4a9c75 100644 --- a/addons/arsenal/Cfg3DEN.hpp +++ b/addons/arsenal/Cfg3DEN.hpp @@ -110,7 +110,7 @@ class Cfg3DEN { h = QUOTE(65 * ATTRIBUTE_H); drawSideArrows = 1; disableOverflow = 1; - columns[] = {0.05, 0.15, 0.85}; + columns[] = {0.05, 0.15, 0.83, 0.87}; }; class ArrowLeft: ctrlButton { idc = IDC_ATTRIBUTE_LIST_LEFT; diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index ca34487c97..94d4739b60 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -16,6 +16,8 @@ PREP(attributeKeyDown); PREP(attributeLoad); PREP(attributeMode); PREP(attributeSelect); +PREP(baseAttachment); +PREP(baseOptic); PREP(baseWeapon); PREP(buttonActionsPage); PREP(buttonCargo); @@ -96,6 +98,7 @@ PREP(statBarStatement_rateOfFIre); PREP(statTextStatement_accuracy); PREP(statTextStatement_explosionTime); PREP(statTextStatement_illuminators); +PREP(statTextStatement_load); PREP(statTextStatement_magCount); PREP(statTextStatement_mass); PREP(statTextStatement_rateOfFire); diff --git a/addons/arsenal/XEH_postInit.sqf b/addons/arsenal/XEH_postInit.sqf index ac6283e604..7c7c677819 100644 --- a/addons/arsenal/XEH_postInit.sqf +++ b/addons/arsenal/XEH_postInit.sqf @@ -22,7 +22,8 @@ GVAR(lastSortDirectionRight) = DESCENDING; params ["_object"]; // If the arsenal is already open, refresh arsenal display - if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object}) then { + // Deliberate == check, fail on objNull + if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object}) then { [true, true] call FUNC(refresh); }; }] call CBA_fnc_addEventHandler; @@ -69,7 +70,7 @@ GVAR(lastSortDirectionRight) = DESCENDING; if (!isNil QGVAR(currentLoadoutsTab) && {GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts}) then { private _curSelData = _contentPanelCtrl lnbData [lnbCurSelRow _contentPanelCtrl, 1]; - ([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"]; + ([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"]; _extendedLoadout params ["_loadout"]; private _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName]; @@ -80,10 +81,10 @@ GVAR(lastSortDirectionRight) = DESCENDING; _contentPanelCtrl lnbSetData [[_newRow, 1], _playerName + _loadoutName]; // Set color of row, depending if items are unavailable/missing - if (_nullItemsAmount > 0) then { + if (_nullItemsList isNotEqualTo []) then { _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; } else { - if (_unavailableItemsAmount > 0) then { + if (_unavailableItemsList isNotEqualTo []) then { _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; }; }; @@ -107,24 +108,16 @@ GVAR(lastSortDirectionRight) = DESCENDING; private _face = _extendedInfo getOrDefault [QGVAR(face), ""]; if (_face != "") then { - if (isMultiplayer) then { - private _id = [QGVAR(broadcastFace), [_unit, _face], QGVAR(centerFace_) + netId _unit] call CBA_fnc_globalEventJIP; - [_id, _unit] call CBA_fnc_removeGlobalEventJIP; - } else { - _unit setFace _face; - }; + private _id = [QGVAR(broadcastFace), [_unit, _face], QGVAR(centerFace_) + hashValue _unit] call CBA_fnc_globalEventJIP; + [_id, _unit] call CBA_fnc_removeGlobalEventJIP; }; // Set voice private _voice = _extendedInfo getOrDefault [QGVAR(voice), ""]; if (_voice != "") then { - if (isMultiplayer) then { - private _id = [QGVAR(broadcastVoice), [_unit, _voice], QGVAR(centerVoice_) + netId _unit] call CBA_fnc_globalEventJIP; - [_id, _unit] call CBA_fnc_removeGlobalEventJIP; - } else { - _unit setSpeaker _voice; - }; + private _id = [QGVAR(broadcastVoice), [_unit, _voice], QGVAR(centerVoice_) + hashValue _unit] call CBA_fnc_globalEventJIP; + [_id, _unit] call CBA_fnc_removeGlobalEventJIP; }; // Set insignia @@ -146,7 +139,7 @@ GVAR(lastSortDirectionRight) = DESCENDING; // Set voice if enabled if (GVAR(loadoutsSaveVoice)) then { - _extendedInfo set [QGVAR(voice), speaker _unit]; + _extendedInfo set [QGVAR(voice), (speaker _unit) call EFUNC(common,getConfigName)]; }; // Set insignia if enabled diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index df4da91338..10cc3989e9 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -12,57 +12,10 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" // Arsenal events -[QGVAR(statsToggle), { - params ["_display", "_showStats"]; - - private _statsCtrlGroupCtrl = _display displayCtrl IDC_statsBox; - private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage; - private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage; - private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage; - - { - _x ctrlShow (GVAR(showStats) && {_showStats}); - } forEach [ - _statsCtrlGroupCtrl, - _statsPreviousPageCtrl, - _statsNextPageCtrl, - _statsCurrentPageCtrl - ]; -}] call CBA_fnc_addEventHandler; - -[QGVAR(statsChangePage), { - _this call FUNC(buttonStatsPage); -}] call CBA_fnc_addEventHandler; - -[QGVAR(displayStats), { - _this call FUNC(handleStats); -}] call CBA_fnc_addEventHandler; - -[QGVAR(actionsChangePage), { - _this call FUNC(buttonActionsPage); -}] call CBA_fnc_addEventHandler; - -[QGVAR(displayActions), { - _this call FUNC(handleActions); -}] call CBA_fnc_addEventHandler; - -[QGVAR(actionsToggle), { - params ["_display", "_showActions"]; - - private _actionsCtrlGroupCtrl = _display displayCtrl IDC_actionsBox; - private _actionsPreviousPageCtrl = _display displayCtrl IDC_actionsPreviousPage; - private _actionsNextPageCtrl = _display displayCtrl IDC_actionsNextPage; - private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage; - - { - _x ctrlShow (GVAR(showActions) && {_showActions}); - } forEach [ - _actionsCtrlGroupCtrl, - _actionsPreviousPageCtrl, - _actionsNextPageCtrl, - _actionsCurrentPageCtrl - ]; -}] call CBA_fnc_addEventHandler; +[QGVAR(statsChangePage), LINKFUNC(buttonStatsPage)] call CBA_fnc_addEventHandler; +[QGVAR(displayStats), LINKFUNC(handleStats)] call CBA_fnc_addEventHandler; +[QGVAR(actionsChangePage), LINKFUNC(buttonActionsPage)] call CBA_fnc_addEventHandler; +[QGVAR(displayActions), LINKFUNC(handleActions)] call CBA_fnc_addEventHandler; call FUNC(compileActions); call FUNC(compileSorts); @@ -83,8 +36,59 @@ call FUNC(compileStats); EGVAR(common,blockItemReplacement) = false; }] call CBA_fnc_addEventHandler; +[QGVAR(cargoChanged), { + params ["_display"]; + // Only update actions if necessary, this can get performance-intensive using the arrow keys + if (!GVAR(updateActionsOnCargoChange)) exitWith {}; + private _actionInfo = [_display]; + _actionInfo append GVAR(actionInfo); + [QGVAR(displayActions), _actionInfo] call CBA_fnc_localEvent; +}] call CBA_fnc_addEventHandler; + // Setup Tools tab [keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton); +// TODO: make IDCs able to match IDX with simple math? +GVAR(idxMap) = createHashMapFromArray [ + [IDC_buttonPrimaryWeapon, IDX_VIRT_PRIMARY_WEAPONS], + [IDC_buttonHandgun, IDX_VIRT_HANDGUN_WEAPONS], + [IDC_buttonSecondaryWeapon, IDX_VIRT_SECONDARY_WEAPONS], + [IDC_buttonHeadgear, IDX_VIRT_HEADGEAR], + [IDC_buttonUniform, IDX_VIRT_UNIFORM], + [IDC_buttonVest, IDX_VIRT_VEST], + [IDC_buttonBackpack, IDX_VIRT_BACKPACK], + [IDC_buttonGoggles, IDX_VIRT_GOGGLES], + [IDC_buttonNVG, IDX_VIRT_NVG], + [IDC_buttonBinoculars, IDX_VIRT_BINO], + [IDC_buttonMap, IDX_VIRT_MAP], + [IDC_buttonGPS, IDX_VIRT_COMMS], + [IDC_buttonRadio, IDX_VIRT_RADIO], + [IDC_buttonCompass, IDX_VIRT_COMPASS], + [IDC_buttonWatch, IDX_VIRT_WATCH] +]; + +// Make new hashmaps for face/voice/insignia so mission makers can disable them +// Copies of hashmaps aren't final +GVAR(faceCache) = +(uiNamespace getVariable QGVAR(faceCache)); +GVAR(voiceCache) = +(uiNamespace getVariable QGVAR(voiceCache)); +GVAR(insigniaCache) = +(uiNamespace getVariable QGVAR(insigniaCache)); + +// Get mission/campaign insignias +// BIS_fnc_setUnitInsignia will look in mission config, then campaign, then global config last, so overwrite accordingly +private _insigniaCondition = toString { + if (isNumber (_x >> "scope")) then { + getNumber (_x >> "scope") == 2 + } else { + true + }; +}; + +// Ref fnc_addListBoxItem, 0/nil = configFile, 1 = campaignConfigFile, 2 = missionConfigFile +{ + GVAR(insigniaCache) set [_x, 1]; +} forEach (_insigniaCondition configClasses (campaignConfigFile >> "CfgUnitInsignia")); +{ + GVAR(insigniaCache) set [_x, 2]; +} forEach (_insigniaCondition configClasses (missionConfigFile >> "CfgUnitInsignia")); ADDON = true; diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index 73116dde76..cd6d937426 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -155,6 +155,8 @@ #define IDC_statsNextPage 53 #define IDC_statsCurrentPage 54 #define IDC_actionsBox 90 +#define IDC_actionsBackground1 90010 +#define IDC_actionsBackground2 90011 #define IDC_actionsText1 9001 #define IDC_actionsButton1 9002 #define IDC_actionsText2 9003 @@ -268,6 +270,7 @@ #define IDX_VIRT_UNIQUE_UNKNOWN_ITEMS 25 // Indexes of current items array +// Should match IDX_VIRT_X macros for any left panel tabs #define IDX_CURR_PRIMARY_WEAPON 0 #define IDX_CURR_SECONDARY_WEAPON 1 #define IDX_CURR_HANDGUN_WEAPON 2 @@ -487,3 +490,6 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\ _contentPanelCtrl lnbSetPicture [[_newRow, 7], getText (configFile >> "CfgVehicles" >> (_loadout select IDX_LOADOUT_BACKPACK) select 0 >> "picture")];\ _contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (_cfgWeapons >> _loadout select IDX_LOADOUT_HEADGEAR >> "picture")];\ _contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "CfgGlasses" >> _loadout select IDX_LOADOUT_GOGGLES >> "picture")]; + +#define ACTION_TYPE_TEXT 0 +#define ACTION_TYPE_BUTTON 1 diff --git a/addons/arsenal/functions/fnc_addAction.sqf b/addons/arsenal/functions/fnc_addAction.sqf index 4606be5abe..b04d56729a 100644 --- a/addons/arsenal/functions/fnc_addAction.sqf +++ b/addons/arsenal/functions/fnc_addAction.sqf @@ -1,4 +1,5 @@ #include "..\script_component.hpp" +#include "..\defines.hpp" /* * Author: johnb43 * Adds custom action buttons. @@ -10,6 +11,7 @@ * 3: Actions * 4: Condition (default: {true}) * 5: Scope editor (default: 2) + * 6: Update when cargo content changes (default: false) * * Return Value: * 0: Array of IDs @@ -30,7 +32,8 @@ params [ ["_title", "", [""]], ["_actions", [], [[]]], ["_rootCondition", {true}, [{}]], - ["_scopeEditor", 2, [0]] + ["_scopeEditor", 2, [0]], + ["_updateOnCargoChange", false, [false]] ]; // Compile actions from config (in case this is called before preInit) @@ -38,13 +41,13 @@ call FUNC(compileActions); // Skip if not allowed in editor and in editor if (is3DEN && {_scopeEditor != 2}) exitWith { - TRACE_1("Skipping action because in editor", _rootClass); + TRACE_1("Skipping action because in editor",_rootClass); [] }; // Class can't contain ~, because it's used for formatting result if ("~" in _rootClass) exitWith { - TRACE_1("Classname can't contain '~'", _rootClass); + TRACE_1("Classname can't contain '~'",_rootClass); [] }; @@ -65,7 +68,7 @@ private _fnc_addToGroup = { // Don't allow two of the same class if (_group findIf {(_x select 0) == _class} != -1) then { - TRACE_1("An action with this ID already exists", _class); + TRACE_1("An action with this ID already exists",_class); continue; }; @@ -119,4 +122,8 @@ private _group = []; }; } forEach _tabs; +if (_updateOnCargoChange) then { + GVAR(updateActionsOnCargoChange) = true; +}; + _return diff --git a/addons/arsenal/functions/fnc_addDefaultLoadout.sqf b/addons/arsenal/functions/fnc_addDefaultLoadout.sqf index b9b8853f15..f54ff03eeb 100644 --- a/addons/arsenal/functions/fnc_addDefaultLoadout.sqf +++ b/addons/arsenal/functions/fnc_addDefaultLoadout.sqf @@ -20,8 +20,9 @@ params [["_name", "", [""]], ["_loadout", [], [[]]], ["_global", false, [false]]]; -if (_global) then { - [QGVAR(addDefaultLoadout), [_name, _loadout]] call CBA_fnc_remoteEvent; +if (_global) exitWith { + private _eventID = format [QGVAR(loadouts_%1), _name]; + [QGVAR(addDefaultLoadout), [_name, _loadout], _eventID] call CBA_fnc_globalEventJIP; }; private _extendedInfo = createHashMap; diff --git a/addons/arsenal/functions/fnc_addListBoxItem.sqf b/addons/arsenal/functions/fnc_addListBoxItem.sqf index 2852aa7232..777b1efe87 100644 --- a/addons/arsenal/functions/fnc_addListBoxItem.sqf +++ b/addons/arsenal/functions/fnc_addListBoxItem.sqf @@ -6,9 +6,10 @@ * * Arguments: * 0: Config category, must be "CfgWeapons", "CfgVehicles", "CfgMagazines", "CfgVoice" or "CfgUnitInsignia" - * 1: Classname + * 1: Classname (must be in config case) * 2: Panel control * 3: Name of the picture entry in that Cfg class (default: "picture") + * 4: Config root (default: 0 -> configFile) * * Return Value: * None @@ -19,9 +20,9 @@ * Public: Yes */ -params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]]]; +params ["_configCategory", "_className", "_ctrlPanel", ["_pictureEntryName", "picture", [""]], ["_configRoot", 0, [0]]]; -private _skip = GVAR(favoritesOnly) && {!(_className in GVAR(currentItems))} && {!((toLower _className) in GVAR(favorites))}; +private _skip = GVAR(favoritesOnly) && {!(_className in GVAR(currentItems))} && {!((toLowerANSI _className) in GVAR(favorites))}; if (_skip) then { switch (GVAR(currentLeftPanel)) do { case IDC_buttonPrimaryWeapon: { @@ -41,10 +42,10 @@ if (_skip) then { if (_skip) exitWith {}; -// Sanitise key, as it's public; If not in cache, find info and cache it for later use -((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className, { +// If not in cache, find info and cache it for later use +((uiNamespace getVariable QGVAR(addListBoxItemCache)) getOrDefaultCall [_configCategory + _className + str _configRoot, { // Get classname (config case), display name, picture and DLC - private _configPath = configFile >> _configCategory >> _className; + private _configPath = ([configFile, campaignConfigFile, missionConfigFile] select _configRoot) >> _configCategory >> _className; private _dlcName = _configPath call EFUNC(common,getAddon); // If _pictureEntryName is empty, then this item has no picture (e.g. faces) @@ -57,7 +58,7 @@ _ctrlPanel lbSetPicture [_lbAdd, _itemPicture]; _ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)]; _ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]]; -if ((toLower _className) in GVAR(favorites)) then { +if ((toLowerANSI _className) in GVAR(favorites)) then { _ctrlPanel lbSetColor [_lbAdd, FAVORITES_COLOR]; _ctrlPanel lbSetSelectColor [_lbAdd, FAVORITES_COLOR]; }; diff --git a/addons/arsenal/functions/fnc_addRightPanelButton.sqf b/addons/arsenal/functions/fnc_addRightPanelButton.sqf index 6e1035a86a..a1bdb09d1d 100644 --- a/addons/arsenal/functions/fnc_addRightPanelButton.sqf +++ b/addons/arsenal/functions/fnc_addRightPanelButton.sqf @@ -66,7 +66,8 @@ _items = _items select { _x isKindOf ["CBA_MiscItem", _cfgWeapons] && {getNumber (_configItemInfo >> "type") in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD]} || {getNumber (_configItemInfo >> "type") in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} || {getText (_cfgWeapons >> _x >> "simulation") == "ItemMineDetector"} || - {getNumber (_cfgMagazines >> _x >> "ACE_isUnique") == 1} + {getNumber (_cfgMagazines >> _x >> "ACE_isUnique") == 1} || + {getNumber (_cfgMagazines >> _x >> "ACE_asItem") == 1} }; GVAR(customRightPanelButtons) set [_position, [_items apply {_x call EFUNC(common,getConfigName)}, _picture, _tooltip, _moveOnOverwrite]]; diff --git a/addons/arsenal/functions/fnc_addSort.sqf b/addons/arsenal/functions/fnc_addSort.sqf index 053f2ff52f..767660402f 100644 --- a/addons/arsenal/functions/fnc_addSort.sqf +++ b/addons/arsenal/functions/fnc_addSort.sqf @@ -72,7 +72,7 @@ private _fnc_addToTabs = { _currentTab pushBack _sort; _return pushBack _sortName; } else { - TRACE_1("A sort with this ID already exists", _sortName); + TRACE_1("A sort with this ID already exists",_sortName); }; } forEach _tabsToAddTo; }; diff --git a/addons/arsenal/functions/fnc_addStat.sqf b/addons/arsenal/functions/fnc_addStat.sqf index 98dfe45213..d618b96a93 100644 --- a/addons/arsenal/functions/fnc_addStat.sqf +++ b/addons/arsenal/functions/fnc_addStat.sqf @@ -77,7 +77,7 @@ private _fnc_addToTabs = { // Find if there is an entry with same ID if (_currentTab findIf {_x select 5 == _statName} != -1) then { - TRACE_1("A stat with this ID already exists", _statName); + TRACE_1("A stat with this ID already exists",_statName); } else { _stat = +_finalArray; _stat set [5, _statName]; @@ -109,11 +109,10 @@ private _tabToChange = []; { _x params ["_tab", "_tabSide"]; - _tabToChange = if (_tabSide == "R") then { + _tabToChange = [ + GVAR(statsListLeftPanel), GVAR(statsListRightPanel) - } else { - GVAR(statsListLeftPanel) - }; + ] select (_tabSide == "R"); _stats = _tabToChange select _tab; diff --git a/addons/arsenal/functions/fnc_attributeAddItems.sqf b/addons/arsenal/functions/fnc_attributeAddItems.sqf index 5457a920a2..612e894a15 100644 --- a/addons/arsenal/functions/fnc_attributeAddItems.sqf +++ b/addons/arsenal/functions/fnc_attributeAddItems.sqf @@ -46,6 +46,7 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _cfgMagazines = configFile >> "CfgMagazines"; private _cfgVehicles = configFile >> "CfgVehicles"; private _cfgGlasses = configFile >> "CfgGlasses"; +private _dlcName = ""; // Exit with current items (no specific category) if (_category == IDX_CAT_ALL) exitWith { @@ -73,6 +74,12 @@ if (_category == IDX_CAT_ALL) exitWith { _listbox lnbSetData [[_index, 1], _x]; _listbox lnbSetPicture [[_index, 0], getText (_config >> "picture")]; _listbox lnbSetTooltip [[_index, 0], _x]; + + _dlcName = _config call EFUNC(common,getAddon); + + if (_dlcName != "") then { + _listbox lnbSetPicture [[_index, 2], (modParams [_dlcName, ["logo"]]) param [0, ""]]; + }; }; } forEach _attributeItems; @@ -130,12 +137,20 @@ private _config = _cfgClass; _alpha = 0.5; }; - _index = _listbox lnbAddRow ["", _displayName, _symbol]; + _index = _listbox lnbAddRow ["", _displayName, "", _symbol]; _listbox lnbSetData [[_index, 1], _x]; _listbox lnbSetPicture [[_index, 0], getText (_config >> _x >> "picture")]; _listbox lnbSetTooltip [[_index, 0], _x]; _listbox lnbSetColor [[_index, 1], [1, 1, 1, _alpha]]; - _listbox lnbSetColor [[_index, 2], [1, 1, 1, _alpha]]; + _listbox lnbSetColor [[_index, 3], [1, 1, 1, _alpha]]; + + // Mod icon is in column 2 + _dlcName = (_config >> _x) call EFUNC(common,getAddon); + + if (_dlcName != "") then { + _listbox lnbSetPicture [[_index, 2], (modParams [_dlcName, ["logo"]]) param [0, ""]]; + _listbox lnbSetPictureColor [[_index, 2], [1, 1, 1, _alpha]]; + }; }; } forEach (keys _categoryItems); diff --git a/addons/arsenal/functions/fnc_attributeSelect.sqf b/addons/arsenal/functions/fnc_attributeSelect.sqf index 5aeb46c5a4..2f9df7775e 100644 --- a/addons/arsenal/functions/fnc_attributeSelect.sqf +++ b/addons/arsenal/functions/fnc_attributeSelect.sqf @@ -35,9 +35,10 @@ if (_addItem && {_itemIndex == -1}) exitWith { _attributeItems pushBack _itemClassname; // Change symbol and increase alpha - _listbox lnbSetText [[_currentRow, 2], [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode]; + _listbox lnbSetText [[_currentRow, 3], [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode]; _listbox lnbSetColor [[_currentRow, 1], [1, 1, 1, 1]]; - _listbox lnbSetColor [[_currentRow, 2], [1, 1, 1, 1]]; + _listbox lnbSetPictureColor [[_currentRow, 2], [1, 1, 1, 1]]; // mod icon is in column 2 + _listbox lnbSetColor [[_currentRow, 3], [1, 1, 1, 1]]; }; // Remove item if in list @@ -45,7 +46,8 @@ if (!_addItem && {_itemIndex != -1}) exitWith { _attributeItems deleteAt _itemIndex; // Change symbol and reduce alpha - _listbox lnbSetText [[_currentRow, 2], SYMBOL_ITEM_NONE]; + _listbox lnbSetText [[_currentRow, 3], SYMBOL_ITEM_NONE]; _listbox lnbSetColor [[_currentRow, 1], [1, 1, 1, 0.5]]; - _listbox lnbSetColor [[_currentRow, 2], [1, 1, 1, 0.5]]; + _listbox lnbSetPictureColor [[_currentRow, 2], [1, 1, 1, 0.5]]; // mod icon is in column 2 + _listbox lnbSetColor [[_currentRow, 3], [1, 1, 1, 0.5]]; }; diff --git a/addons/arsenal/functions/fnc_baseAttachment.sqf b/addons/arsenal/functions/fnc_baseAttachment.sqf new file mode 100644 index 0000000000..968fd05d9b --- /dev/null +++ b/addons/arsenal/functions/fnc_baseAttachment.sqf @@ -0,0 +1,59 @@ +#include "..\script_component.hpp" +/* + * Author: Jonpas, LinkIsGrim + * Returns base attachment for CBA scripted attachment + * Adapted from CBA_fnc_switchableAttachments + * + * Arguments: + * 0: Attachment + * + * Return Value: + * Base attachment + * + * Example: + * "ACE_acc_pointer_green_IR" call ace_arsenal_fnc_baseAttachment + * + * Public: Yes + */ + +params [["_item", "", [""]]]; + +TRACE_1("looking up base attachment",_item); + +private _switchableClasses = []; + +private _cfgWeapons = configfile >> "CfgWeapons"; +private _config = _cfgWeapons >> _item; +_item = configName _config; + +// If the switch config entries are inherited, ignore +if ( + (inheritsFrom (_config >> "MRT_SwitchItemNextClass") isNotEqualTo _config) || + {inheritsFrom (_config >> "MRT_SwitchItemPrevClass") isNotEqualTo _config} +) exitWith { + _item // return +}; + +while { + _config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemNextClass"); + isClass _config && {_switchableClasses pushBackUnique configName _config != -1} +} do {}; + +_config = _cfgWeapons >> _item; +private _backward = []; +while { + _config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemPrevClass"); + isClass _config && {_backward pushBackUnique configName _config != -1} +} do {}; + +_switchableClasses append _backward; +_switchableClasses = _switchableClasses arrayIntersect _switchableClasses; + +{ + if (getNumber (_cfgWeapons >> _x >> "scope") == 2) exitWith { + TRACE_2("found class",_item,_x); + _item = _x; + }; +} forEach _switchableClasses; + +_item diff --git a/addons/arsenal/functions/fnc_baseOptic.sqf b/addons/arsenal/functions/fnc_baseOptic.sqf new file mode 100644 index 0000000000..c3eb5e811a --- /dev/null +++ b/addons/arsenal/functions/fnc_baseOptic.sqf @@ -0,0 +1,32 @@ +#include "..\script_component.hpp" +/* + * Author: Jonpas, LinkIsGrim + * Returns base optic for CBA scripted optics (PIP and 2D) + * + * Arguments: + * 0: Optic + * + * Return Value: + * Base optic + * + * Example: + * "CUP_optic_Elcan_SpecterDR_black_PIP" call ace_arsenal_fnc_baseOptic + * + * Public: Yes + */ + +params [["_optic", "", [""]]]; + +// PIP +private _baseClasses = configProperties [configFile >> "CBA_PIPItems", "getText _x == _optic"]; + +// Carry Handle +{ + _baseClasses append (configProperties [_x, "getText _x == _optic"]); +} forEach configProperties [configFile >> "CBA_CarryHandleTypes"]; + +if (_baseClasses isNotEqualTo []) then { + _optic = configName (_baseClasses select 0); +}; + +_optic diff --git a/addons/arsenal/functions/fnc_baseWeapon.sqf b/addons/arsenal/functions/fnc_baseWeapon.sqf index f166af94ce..abeb0e0ab9 100644 --- a/addons/arsenal/functions/fnc_baseWeapon.sqf +++ b/addons/arsenal/functions/fnc_baseWeapon.sqf @@ -19,7 +19,7 @@ params [["_weapon", "", [""]]]; // Check if item is cached -(uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLower _weapon, { +(uiNamespace getVariable QGVAR(baseWeaponNameCache)) getOrDefaultCall [toLowerANSI _weapon, { private _cfgWeapons = configfile >> "CfgWeapons"; private _config = _cfgWeapons >> _weapon; diff --git a/addons/arsenal/functions/fnc_buttonActionsPage.sqf b/addons/arsenal/functions/fnc_buttonActionsPage.sqf index 17da357100..b3a46a68e3 100644 --- a/addons/arsenal/functions/fnc_buttonActionsPage.sqf +++ b/addons/arsenal/functions/fnc_buttonActionsPage.sqf @@ -2,12 +2,12 @@ #include "..\defines.hpp" /* * Author: Brett Mayson - * Handles the previous / next page buttons for actions + * Handles the previous / next page buttons for actions. * * Arguments: * 0: Arsenal display - * 1: Actions control - * 2: Previous or next (false = previous, true = next) + * 1: Actions page + * 2: Previous (false) or next (true) page * * Return Value: * None @@ -17,10 +17,11 @@ params ["_display", "_control", "_nextPage"]; -TRACE_1("control enabled", ctrlEnabled _control); +TRACE_1("control enabled",ctrlEnabled _control); if !(ctrlEnabled _control) exitWith {}; GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage); GVAR(actionsInfo) params ["_panelControl", "_curSel", "_itemCfg"]; + [QGVAR(displayActions), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonHide.sqf b/addons/arsenal/functions/fnc_buttonHide.sqf index 6b6c84da93..d1bb5657b0 100644 --- a/addons/arsenal/functions/fnc_buttonHide.sqf +++ b/addons/arsenal/functions/fnc_buttonHide.sqf @@ -52,10 +52,20 @@ private _ctrl = controlNull; IDC_buttonCurrentMag2, IDC_iconBackgroundCurrentMag, IDC_iconBackgroundCurrentMag2, + IDC_statsBox, IDC_statsPreviousPage, IDC_statsNextPage, - IDC_statsCurrentPage + IDC_statsCurrentPage, + IDC_actionsBox, + IDC_actionsPreviousPage, + IDC_actionsNextPage, + IDC_actionsCurrentPage ]; -[QGVAR(statsToggle), [_display, _showToggle]] call CBA_fnc_localEvent; -[QGVAR(actionsToggle), [_display, _showToggle]] call CBA_fnc_localEvent; +if (!_showToggle) exitWith {}; + +// When showing the stats/actions again, update them to fit with currently selected item +GVAR(actionsInfo) params ["_control", "_curSel", "_itemCfg"]; + +[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent; +[QGVAR(displayActions), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf index 87191a99c2..d25fa485cf 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf @@ -43,11 +43,7 @@ private _loadoutIndex = _data findIf {(_x select 0) == _loadoutName}; (_data select _loadoutIndex) set [0, _editBoxContent]; if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then { - if (is3DEN) then { - set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]]; - } else { - [QGVAR(renameDefaultLoadout), [_loadoutName, _editBoxContent]] call CBA_fnc_remoteEvent; - }; + set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]]; }; private _currentLoadoutsTab = str GVAR(currentLoadoutsTab); diff --git a/addons/arsenal/functions/fnc_buttonStatsPage.sqf b/addons/arsenal/functions/fnc_buttonStatsPage.sqf index bef2631f8c..33eec398e9 100644 --- a/addons/arsenal/functions/fnc_buttonStatsPage.sqf +++ b/addons/arsenal/functions/fnc_buttonStatsPage.sqf @@ -17,11 +17,11 @@ params ["_display", "_control", "_nextPage"]; -TRACE_1("control enabled", ctrlEnabled _control); +TRACE_1("control enabled",ctrlEnabled _control); if !(ctrlEnabled _control) exitWith {}; -GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage; +GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage); -GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"]; +GVAR(statsInfo) params ["", "_panelControl", "_curSel", "_itemCfg"]; [QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_compileActions.sqf b/addons/arsenal/functions/fnc_compileActions.sqf index 6eda62ac65..9001a5558a 100644 --- a/addons/arsenal/functions/fnc_compileActions.sqf +++ b/addons/arsenal/functions/fnc_compileActions.sqf @@ -1,4 +1,5 @@ #include "..\script_component.hpp" +#include "..\defines.hpp" /* * Author: Brett Mayson * Create the internal actions arrays when needed for the first time. @@ -37,6 +38,8 @@ private _actionList = [ private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions)); +GVAR(updateActionsOnCargoChange) = false; + { private _scopeEditor = getNumber (_x >> "scopeEditor"); @@ -48,6 +51,10 @@ private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions) private _rootDisplayName = getText (_x >> "displayName"); private _rootCondition = getText (_x >> "condition"); private _rootTabs = getArray (_x >> "tabs"); + private _updateOnCargoChanged = getNumber (_x >> "updateOnCargoChanged"); + if (_updateOnCargoChanged > 0) then { + GVAR(updateActionsOnCargoChange) = true; + }; if (_rootCondition != "") then { _rootCondition = compile _rootCondition; diff --git a/addons/arsenal/functions/fnc_compileStats.sqf b/addons/arsenal/functions/fnc_compileStats.sqf index ef8cba2f40..f19854793a 100644 --- a/addons/arsenal/functions/fnc_compileStats.sqf +++ b/addons/arsenal/functions/fnc_compileStats.sqf @@ -101,7 +101,7 @@ private _priority = 0; (_finalArray select 4) set [1, compile (getText (_x >> "textStatement"))]; }; - TRACE_3("stats array", _finalArray, _leftTabsList, _rightTabsList); + TRACE_3("stats array",_finalArray,_leftTabsList,_rightTabsList); if (_leftTabsList isNotEqualTo []) then { [_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs; diff --git a/addons/arsenal/functions/fnc_fillLeftPanel.sqf b/addons/arsenal/functions/fnc_fillLeftPanel.sqf index effcc03d20..1eb98d29ec 100644 --- a/addons/arsenal/functions/fnc_fillLeftPanel.sqf +++ b/addons/arsenal/functions/fnc_fillLeftPanel.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" #include "..\defines.hpp" /* - * Author: Alganthe, johnb43 + * Author: Alganthe, johnb43, LinkIsGrim * Fills left panel. * * Arguments: @@ -17,21 +17,28 @@ params ["_display", "_control", ["_animate", true]]; +private _ctrlIDC = ctrlIDC _control; +private _ctrlPanel = _display displayCtrl IDC_leftTabContent; +private _idxVirt = GVAR(idxMap) getOrDefault [_ctrlIDC, -1, true]; + // Fade old control background if (!isNil QGVAR(currentLeftPanel)) then { private _previousCtrlBackground = _display displayCtrl (GVAR(currentLeftPanel) - 1); _previousCtrlBackground ctrlSetFade 1; _previousCtrlBackground ctrlCommit ([0, FADE_DELAY] select _animate); + + // When switching tabs, clear searchbox + if (GVAR(currentLeftPanel) != _ctrlIDC) then { + (_display displayCtrl IDC_leftSearchbar) ctrlSetText ""; + (_display displayCtrl IDC_rightSearchbar) ctrlSetText ""; + }; }; // Show new control background -private _ctrlIDC = ctrlIDC _control; private _ctrlBackground = _display displayCtrl (_ctrlIDC - 1); _ctrlBackground ctrlSetFade 0; _ctrlBackground ctrlCommit ([0, FADE_DELAY] select _animate); -private _ctrlPanel = _display displayCtrl IDC_leftTabContent; - // Force a "refresh" animation of the panel if (_animate) then { _ctrlPanel ctrlSetFade 1; @@ -41,212 +48,82 @@ if (_animate) then { }; _ctrlPanel lbSetCurSel -1; +// Purge old data +lbClear _ctrlPanel; -// Handle icons and filling -private _selectedItem = switch (true) do { - // Primary weapons, secondary weapons, handgun weapons - case (_ctrlIDC in [IDC_buttonPrimaryWeapon, IDC_buttonHandgun, IDC_buttonSecondaryWeapon]): { - // Purge old data - lbClear _ctrlPanel; - - // Add "Empty" entry - private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"]; - _ctrlPanel lbSetValue [_addEmpty, -1]; - - // Add selected tab's weapons - private _index = [IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun] find _ctrlIDC; - - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys ((GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _index)); - - GVAR(currentItems) select _index - }; - // Uniforms, vests, backpacks - case (_ctrlIDC in [IDC_buttonUniform, IDC_buttonVest, IDC_buttonBackpack]): { - // Purge old data - lbClear _ctrlPanel; - - // Add "Empty" entry - private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"]; - _ctrlPanel lbSetValue [_addEmpty, -1]; - - switch (_ctrlIDC) do { - // Add uniforms - case IDC_buttonUniform: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIFORM)); - - GVAR(currentItems) select IDX_CURR_UNIFORM - }; - // Add vests - case IDC_buttonVest: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_VEST)); - - GVAR(currentItems) select IDX_CURR_VEST - }; - // Add backpacks - case IDC_buttonBackpack: { - { - ["CfgVehicles", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_BACKPACK)); - - GVAR(currentItems) select IDX_CURR_BACKPACK - }; - }; - }; - // Other - default { - // Don't reset right panel selection if left tab is binos - if (_ctrlIDC != IDC_buttonBinoculars) then { - GVAR(currentRightPanel) = nil; - }; - - lbClear _ctrlPanel; - - // For every left tab except faces and voices, add "Empty" entry - if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then { - private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"]; - _ctrlPanel lbSetValue [_addEmpty, -1]; - }; - - switch (_ctrlIDC) do { - // Headgear - case IDC_buttonHeadgear: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_HEADGEAR)); - - GVAR(currentItems) select IDX_CURR_HEADGEAR - }; - // Facewear - case IDC_buttonGoggles: { - { - ["CfgGlasses", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_GOGGLES)); - - GVAR(currentItems) select IDX_CURR_GOGGLES - }; - // NVGs - case IDC_buttonNVG: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_NVG)); - - GVAR(currentItems) select IDX_CURR_NVG - }; - // Binoculars - case IDC_buttonBinoculars: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_BINO)); - - GVAR(currentItems) select IDX_CURR_BINO - }; - // Maps - case IDC_buttonMap: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_MAP)); - - GVAR(currentItems) select IDX_CURR_MAP - }; - // Compasses - case IDC_buttonCompass: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_COMPASS)); - - GVAR(currentItems) select IDX_CURR_COMPASS - }; - // Radios - case IDC_buttonRadio: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_RADIO)); - - GVAR(currentItems) select IDX_CURR_RADIO - }; - // Watches - case IDC_buttonWatch: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_WATCH)); - - GVAR(currentItems) select IDX_CURR_WATCH - }; - // GPS and UAV Terminals - case IDC_buttonGPS: { - { - ["CfgWeapons", _x, _ctrlPanel] call FUNC(addListBoxItem); - } forEach (keys (GVAR(virtualItems) get IDX_VIRT_COMMS)); - - GVAR(currentItems) select IDX_CURR_COMMS - }; - // Faces - case IDC_buttonFace: { - private _lbAdd = -1; - - { - _y params ["_displayName", "_modPicture"]; - - _lbAdd = _ctrlPanel lbAdd _displayName; - _ctrlPanel lbSetData [_lbAdd, _x]; - _ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]]; - _ctrlPanel lbSetPictureRight [_lbAdd, _modPicture]; - } forEach (uiNamespace getVariable QGVAR(faceCache)); - - GVAR(currentFace) - }; - // Voices - case IDC_buttonVoice: { - { - ["CfgVoice", _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem); - } forEach (uiNamespace getVariable QGVAR(voiceCache)); - - GVAR(currentVoice) - }; - // Insignia - case IDC_buttonInsignia: { - // Insignia from config - { - ["CfgUnitInsignia", _x, _ctrlPanel, "texture"] call FUNC(addListBoxItem); - } forEach (uiNamespace getVariable QGVAR(insigniaCache)); - - private _displayName = ""; - private _className = ""; - private _lbAdd = -1; - - // Insignia from mission file - { - _className = configName _x; - _displayName = getText (_x >> "displayName"); - _lbAdd = _ctrlPanel lbAdd _displayName; - - _ctrlPanel lbSetData [_lbAdd, _className]; - _ctrlPanel lbSetPicture [_lbAdd, getText (_x >> "texture")]; - _ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _className]]; - } forEach ("(if (isNumber (_x >> 'scope')) then {getNumber (_x >> 'scope')} else {2}) == 2" configClasses (missionConfigFile >> "CfgUnitInsignia")); - - GVAR(currentInsignia) - }; - // Unknown - default {""}; - }; - }; +// For every left tab except faces and voices, add "Empty" entry +if !(_ctrlIDC in [IDC_buttonFace, IDC_buttonVoice]) then { + private _addEmpty = _ctrlPanel lbAdd format [" <%1>", localize "str_empty"]; + _ctrlPanel lbSetValue [_addEmpty, -1]; }; -// When switching tabs, clear searchbox -if (GVAR(currentLeftPanel) != _ctrlIDC) then { - (_display displayCtrl IDC_leftSearchbar) ctrlSetText ""; - (_display displayCtrl IDC_rightSearchbar) ctrlSetText ""; +// Don't reset the current right panel for weapons, binos and containers +if !(_idxVirt in [IDX_VIRT_PRIMARY_WEAPONS, IDX_VIRT_SECONDARY_WEAPONS, IDX_VIRT_HANDGUN_WEAPONS, IDX_VIRT_BINO, IDX_VIRT_UNIFORM, IDX_VIRT_VEST, IDX_VIRT_BACKPACK]) then { + GVAR(currentRightPanel) = nil; +}; +GVAR(currentLeftPanel) = _ctrlIDC; + +// Add items to the listbox +private _selectedItem = if (_idxVirt != -1) then { // Items + private _configParent = switch (_idxVirt) do { + case IDX_VIRT_GOGGLES: {"CfgGlasses"}; + case IDX_VIRT_BACKPACK: {"CfgVehicles"}; + default {"CfgWeapons"}; + }; + + private _items = if (_idxVirt < IDX_VIRT_HEADGEAR) then { + keys ((GVAR(virtualItems) get IDX_VIRT_WEAPONS) get _idxVirt) + } else { + keys (GVAR(virtualItems) get _idxVirt) + }; + + { + [_configParent, _x, _ctrlPanel] call FUNC(addListBoxItem); + } forEach _items; + + GVAR(currentItems) select _idxVirt +} else { // Special cases + switch (_ctrlIDC) do { + // Faces + case IDC_buttonFace: { + private _lbAdd = -1; // micro-optimization + // Faces need to be added like this because their config path is + // configFile >> "CfgFaces" >> face category >> className + { + _y params ["_displayName", "_modPicture"]; + _lbAdd = _ctrlPanel lbAdd _displayName; + _ctrlPanel lbSetData [_lbAdd, _x]; + _ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]]; + _ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)]; + } forEach GVAR(faceCache); // HashMap, not array + + GVAR(currentFace) + }; + // Voices + case IDC_buttonVoice: { + { + ["CfgVoice", _x, _ctrlPanel, "icon"] call FUNC(addListBoxItem); + } forEach (keys GVAR(voiceCache)); + + GVAR(currentVoice) + }; + // Insignia + case IDC_buttonInsignia: { + { + ["CfgUnitInsignia", _x, _ctrlPanel, "texture", _y] call FUNC(addListBoxItem); + } forEach GVAR(insigniaCache); + + GVAR(currentInsignia) + }; + // Unknown + default { + WARNING_1("Unknown arsenal left panel with IDC %1, update ace_arsenal_idxMap and relevant macros if adding a new tab",_ctrlIDC); + "" + }; + }; }; // Trigger event -GVAR(currentLeftPanel) = _ctrlIDC; [QGVAR(leftPanelFilled), [_display, _ctrlIDC, GVAR(currentRightPanel)]] call CBA_fnc_localEvent; // Sort diff --git a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf index 7d5152dfdd..6174193b73 100644 --- a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf +++ b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf @@ -1,12 +1,16 @@ #include "..\script_component.hpp" #include "..\defines.hpp" /* - * Author: Alganthe, johnb43 - * Fill loadouts list. + * Author: Alganthe, johnb43, LinkIsGrim + * Fill loadouts list over multiple frames. LOADOUTS_PER_FRAME macro does what it says on the tin. + * Should only ever be called by display load (with optional params as default) and by itself. + * Listen to ace_arsenal_loadoutsListFilled event if you need to iterate over the loadouts list. * * Arguments: * 0: Loadouts display * 1: Tab control + * 2: Current frame filling loadouts list (default: 0) + * 3: Frames necessary to fill loadouts list (default: -1) * * Return Value: * None @@ -14,29 +18,46 @@ * Public: No */ -params ["_display", "_control"]; +// Can just be modified directly, no further setup needed +#define LOADOUTS_PER_FRAME 10 -(_display displayCtrl IDC_textEditBox) ctrlSetText ""; +params ["_display", "_control", ["_currentFrame", 0], ["_framesToFill", -1]]; + +if (isNull _display) exitWith { + TRACE_2("display closed, aborting",_currentFrame,_framesToFill); +}; private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; +if (_currentFrame == 0) then { + (_display displayCtrl IDC_textEditBox) ctrlSetText ""; -// Force a "refresh" animation of the panel -_contentPanelCtrl ctrlSetFade 1; -_contentPanelCtrl ctrlCommit 0; -_contentPanelCtrl ctrlSetFade 0; -_contentPanelCtrl ctrlCommit FADE_DELAY; + // Force a "refresh" animation of the panel + _contentPanelCtrl ctrlSetFade 1; + _contentPanelCtrl ctrlCommit 0; + _contentPanelCtrl ctrlSetFade 0; + _contentPanelCtrl ctrlCommit FADE_DELAY; -_contentPanelCtrl lnbSetCurSelRow -1; -lnbClear _contentPanelCtrl; + _contentPanelCtrl lnbSetCurSelRow -1; + lnbClear _contentPanelCtrl; +}; private _sharedLoadoutsVars = GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars); -private _cfgWeapons = configFile >> "CfgWeapons"; +private _cfgWeapons = configFile >> "CfgWeapons"; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove private _newRow = -1; if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { private _loadoutNameAndTab = ""; private _loadoutCachedInfo = ""; private _sharingEnabled = GVAR(allowSharedLoadouts) && {isMultiplayer}; + private _loadouts = [ + profileNamespace getVariable [QGVAR(saved_loadouts), []], + GVAR(defaultLoadoutsList) + ] select (ctrlIDC _control == IDC_buttonDefaultLoadouts); + if (_currentFrame == 0) then { + _framesToFill = floor ((count _loadouts) / LOADOUTS_PER_FRAME); + TRACE_2("filling loadouts list",_currentFrame,_framesToFill); + _this set [3, _framesToFill]; + }; // Add all loadouts to loadout list { @@ -50,15 +71,16 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { _loadoutCachedInfo = [_loadoutData] call FUNC(verifyLoadout); _contentPanelCtrl setVariable [_loadoutNameAndTab, _loadoutCachedInfo]; - _loadoutCachedInfo params ["", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"]; + _loadoutCachedInfo params ["", "_nullItemsList", "_unavailableItemsList", "_missingExtendedInfo"]; // Log missing / nil items to RPT (only once per arsenal session) - if (GVAR(EnableRPTLog) && {(_nullItemsAmount > 0) || {_unavailableItemsAmount > 0}}) then { + if (GVAR(EnableRPTLog) && {(_nullItemsList isNotEqualTo []) || {_unavailableItemsList isNotEqualTo [] || {_missingExtendedInfo isNotEqualTo []}}}) then { private _printComponent = "ACE_Arsenal - Loadout:"; private _printNullItemsList = ["Missing items:", str _nullItemsList] joinString " "; private _printUnavailableItemsList = ["Unavailable items:", str _unavailableItemsList] joinString " "; + private _printMissingExtendedInfo = ["Missing extended loadout:", str _missingExtendedInfo] joinString " "; - diag_log text (format ["%1%5 %2%5 %3%5 %4", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, endl]); + diag_log text (format ["%1%6 %2%6 %3%6 %4%6 %5", _printComponent, "Name: " + _loadoutName, _printNullItemsList, _printUnavailableItemsList, _printMissingExtendedInfo, endl]); }; }; @@ -69,18 +91,18 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { _contentPanelCtrl lnbSetColumnsPos [0, 0.05, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90]; }; - _loadoutCachedInfo params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"]; - _extendedLoadout params ["_loadout"]; + _loadoutCachedInfo params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"]; + _extendedLoadout params ["_loadout"]; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove _newRow = _contentPanelCtrl lnbAddRow ["", _loadoutName]; ADD_LOADOUTS_LIST_PICTURES // Change color on loadout lines that have items that aren't available or don't exist - if (_nullItemsAmount > 0) then { + if (_nullItemsList isNotEqualTo []) then { _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red } else { - if (_unavailableItemsAmount > 0) then { + if (_unavailableItemsList isNotEqualTo []) then { _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray }; }; @@ -90,10 +112,16 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { _contentPanelCtrl lnbSetPicture [[_newRow, 0], QPATHTOF(data\iconPublic.paa)]; _contentPanelCtrl lnbSetValue [[_newRow, 0], 1]; }; - } forEach ([profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (ctrlIDC _control == IDC_buttonDefaultLoadouts)); + } forEach (_loadouts select [_currentFrame * LOADOUTS_PER_FRAME, [LOADOUTS_PER_FRAME, count _loadouts] select is3DEN]); } else { private _allPlayerNames = allPlayers apply {name _x}; + private _loadouts = _sharedLoadoutsVars apply {GVAR(sharedLoadoutsNamespace) getVariable _x}; private _loadoutVar = ""; + if (_currentFrame == 0) then { + _framesToFill = floor ((count _loadouts) / LOADOUTS_PER_FRAME); + TRACE_2("filling loadouts list",_currentFrame,_framesToFill); + _this set [3, _framesToFill]; + }; { _x params ["_playerName", "_loadoutName", "_loadoutData"]; @@ -107,8 +135,8 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { [QGVAR(loadoutUnshared), [_contentPanelCtrl, profileName, _loadoutName]] call CBA_fnc_remoteEvent; } else { - ([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsAmount", "_unavailableItemsAmount"]; - _extendedLoadout params ["_loadout"]; + ([_loadoutData] call FUNC(verifyLoadout)) params ["_extendedLoadout", "_nullItemsList", "_unavailableItemsList"]; + _extendedLoadout params ["_loadout"]; // Used by ADD_LOADOUTS_LIST_PICTURES macro, do not remove _contentPanelCtrl lnbSetColumnsPos [0, 0.15, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90]; _newRow = _contentPanelCtrl lnbAddRow [_playerName, _loadoutName]; @@ -118,17 +146,23 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { _contentPanelCtrl lnbSetData [[_newRow, 1], _loadoutVar]; // Change color on loadout lines that have items that aren't available or don't exist - if (_nullItemsAmount > 0) then { + if (_nullItemsList isNotEqualTo []) then { _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red } else { - if (_unavailableItemsAmount > 0) then { + if (_unavailableItemsList isNotEqualTo []) then { _contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray }; }; }; - } forEach (_sharedLoadoutsVars apply {GVAR(sharedLoadoutsNamespace) getVariable _x}); + } forEach (_loadouts select [_currentFrame * LOADOUTS_PER_FRAME, [LOADOUTS_PER_FRAME, count _loadouts] select is3DEN]); }; +if (!is3DEN && _currentFrame != _framesToFill) exitWith { + _this set [2, _currentFrame + 1]; + [FUNC(fillLoadoutsList), _this] call CBA_fnc_execNextFrame; +}; +TRACE_3("finished",_currentFrame,_framesToFill,lnbSize _contentPanelCtrl); + [QGVAR(loadoutsListFilled), [_display, _control]] call CBA_fnc_localEvent; // Sort loadouts alphabetically diff --git a/addons/arsenal/functions/fnc_fillRightPanel.sqf b/addons/arsenal/functions/fnc_fillRightPanel.sqf index 346e07fa59..d8dc7e2403 100644 --- a/addons/arsenal/functions/fnc_fillRightPanel.sqf +++ b/addons/arsenal/functions/fnc_fillRightPanel.sqf @@ -53,7 +53,7 @@ if (GVAR(favoritesOnly)) then { private _fnc_fillRightContainer = { params ["_configCategory", "_className", ["_isUnique", false, [false]], ["_unknownOrigin", false, [false]]]; - if (GVAR(favoritesOnly) && {!(_className in _currentCargo)} && {!((toLower _className) in GVAR(favorites))}) exitWith {}; + if (GVAR(favoritesOnly) && {!(_className in _currentCargo)} && {!((toLowerANSI _className) in GVAR(favorites))}) exitWith {}; // If item is not in the arsenal, it must be unique if (!_isUnique && {!(_className in GVAR(virtualItemsFlat))}) then { @@ -87,9 +87,9 @@ private _fnc_fillRightContainer = { _ctrlPanel lnbSetText [[_lbAdd, 1], _displayName]; _ctrlPanel lnbSetData [[_lbAdd, 0], _className]; _ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture]; - _ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique]; + _ctrlPanel lnbSetValue [[_lbAdd, 2], parseNumber _isUnique]; _ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]]; - if ((toLower _className) in GVAR(favorites)) then { + if ((toLowerANSI _className) in GVAR(favorites)) then { _ctrlPanel lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR]; _ctrlPanel lnbSetColorRight [[_lbAdd, 1], FAVORITES_COLOR]; }; diff --git a/addons/arsenal/functions/fnc_handleActions.sqf b/addons/arsenal/functions/fnc_handleActions.sqf index 8dbffaedfe..03c25f77df 100644 --- a/addons/arsenal/functions/fnc_handleActions.sqf +++ b/addons/arsenal/functions/fnc_handleActions.sqf @@ -7,7 +7,7 @@ * Arguments: * 0: Arsenal display * 1: Current panel control - * 2: Current panel selection + * 2: Current panel selection * 3: Item config entry * * Return Value: @@ -15,7 +15,6 @@ * * Public: No */ - params ["_display", "_control", "_curSel", "_itemCfg"]; GVAR(actionsInfo) = [_control, _curSel, _itemCfg]; @@ -46,13 +45,12 @@ private _groups = (GVAR(actionList) select _panel) select { }; private _show = _groups isNotEqualTo []; -private _ctrl = _display displayCtrl IDC_actionsBox; -_ctrl ctrlShow _show; -_ctrl ctrlCommit 0.15; +private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox; +_actionsBoxCtrl ctrlShow _show; +_actionsBoxCtrl ctrlCommit FADE_DELAY; if (!_show) exitWith {}; -private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox; private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage; private _currentPage = GVAR(currentActionPage); @@ -79,33 +77,29 @@ private _items = _group select 3 select { }; _actionsCurrentPageCtrl ctrlSetText (_group select 1); -_actionsCurrentPageCtrl ctrlSetFade 0; _actionsCurrentPageCtrl ctrlShow true; _actionsCurrentPageCtrl ctrlCommit 0; +private _activeCtrls = []; { _x params ["", "_type", "_label", "_statement"]; - private _idc = 9001 + _forEachIndex * 2; - private _actionTextCtrl = _display displayCtrl _idc; - private _actionButtonCtrl = _display displayCtrl (_idc + 1); + private _idc = IDC_actionsText1 + _type + _forEachIndex * 2; + private _actionCtrl = _display displayCtrl _idc; switch (_type) do { case ACTION_TYPE_BUTTON: { - _actionButtonCtrl ctrlRemoveAllEventHandlers "ButtonClick"; - _actionButtonCtrl ctrlAddEventHandler ["ButtonClick", { + _actionCtrl ctrlRemoveAllEventHandlers "ButtonClick"; + _actionCtrl ctrlAddEventHandler ["ButtonClick", { if (is3DEN) exitWith {[true] call FUNC(refresh)}; [{ [true] call FUNC(refresh); }] call CBA_fnc_execNextFrame; }]; - _actionButtonCtrl ctrlAddEventHandler ["ButtonClick", _statement]; - _actionButtonCtrl ctrlSetText _label; - _actionButtonCtrl ctrlSetFade 0; - _actionButtonCtrl ctrlEnable true; - _actionButtonCtrl ctrlCommit 0; - _actionTextCtrl ctrlSetFade 1; - _actionTextCtrl ctrlCommit 0; + + _actionCtrl ctrlAddEventHandler ["ButtonClick", _statement]; + _actionCtrl ctrlSetText _label; + _actionCtrl ctrlEnable true; }; case ACTION_TYPE_TEXT: { private _text = call _statement; @@ -113,38 +107,43 @@ _actionsCurrentPageCtrl ctrlCommit 0; if (isNil "_text") then { _text = ""; }; + if (_text isEqualType []) then { + _text = _text joinString endl; + }; - _actionTextCtrl ctrlSetText _text; - _actionTextCtrl ctrlSetFade 0; - _actionTextCtrl ctrlCommit 0; - _actionButtonCtrl ctrlSetFade 1; - _actionButtonCtrl ctrlEnable false; - _actionButtonCtrl ctrlCommit 0; - }; - default { - _actionTextCtrl ctrlSetFade 1; - _actionTextCtrl ctrlCommit 0; - _actionButtonCtrl ctrlSetFade 1; - _actionButtonCtrl ctrlEnable false; - _actionButtonCtrl ctrlCommit 0; + _actionCtrl ctrlSetText _text; + _actionCtrl ctrlSetPositionH (ctrlTextHeight _actionCtrl); + _actionCtrl ctrlEnable false; }; }; + + if (_activeCtrls isNotEqualTo []) then { + (ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"]; + _actionCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H); + } else { + _actionCtrl ctrlSetPositionY ((5 + _type) * GRID_H); + }; + + _actionCtrl ctrlShow true; + _actionCtrl ctrlCommit 0; + _activeCtrls pushBack _actionCtrl; } forEach _items; -private _actionCount = count _items; - { - private _idc = 9001 + _x * 2; - private _actionTextCtrl = _display displayCtrl _idc; - private _actionButtonCtrl = _display displayCtrl (_idc + 1); + private _idc = ctrlIDC _x; + if (_idc < IDC_actionsText1 || _idc > IDC_actionsButton5) then {continue}; - _actionTextCtrl ctrlSetFade 1; - _actionTextCtrl ctrlCommit 0; - _actionButtonCtrl ctrlSetFade 1; - _actionButtonCtrl ctrlCommit 0; -} forEach ([0, 1, 2, 3, 4] select [_actionCount, 5]); + _x ctrlShow false; + _x ctrlEnable false; + _x ctrlSetPositionY 0; + _x ctrlCommit 0; +} forEach ((allControls _actionsBoxCtrl) select {!(_x in _activeCtrls)}); -private _pos = ctrlPosition _actionsBoxCtrl; -_pos set [3, ([11, (5 * _actionCount) + 6] select (_actionCount > 0)) * GRID_H]; -_actionsBoxCtrl ctrlSetPosition _pos; +(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"]; +private _actionsBoxHeight = _lastPosY + _lastPosH + GRID_H; +_actionsBoxCtrl ctrlSetPositionH _actionsBoxHeight; _actionsBoxCtrl ctrlCommit 0; + +private _background = _display displayCtrl IDC_actionsBackground1; +_background ctrlSetPositionH _actionsBoxHeight; +_background ctrlCommit 0; diff --git a/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf b/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf index a0203ff5b9..a8938e8c48 100644 --- a/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf +++ b/addons/arsenal/functions/fnc_loadoutsChangeTab.sqf @@ -63,6 +63,7 @@ switch (ctrlIDC _control) do { _saveButtonCtrl ctrlSetTooltip LLSTRING(buttonSaveTooltip); }; + _renameButtonCtrl ctrlEnable is3DEN; // no renaming mid-mission _saveButtonCtrl ctrlEnable call FUNC(canEditDefaultLoadout); _saveButtonCtrl ctrlCommit 0; }; diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index bc862f2de0..f2316bc9d5 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -78,10 +78,10 @@ if (!isNull curatorCamera) then { // Make face and voice selection JIP compatible; 3DEN doesn't need this though if (isMultiplayer && {!is3DEN}) then { - private _id = [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(centerFace_) + netId GVAR(center)] call CBA_fnc_globalEventJIP; + private _id = [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(centerFace_) + hashValue GVAR(center)] call CBA_fnc_globalEventJIP; [_id, GVAR(center)] call CBA_fnc_removeGlobalEventJIP; - _id = [QGVAR(broadcastVoice), [GVAR(center), GVAR(currentVoice)], QGVAR(centerVoice_) + netId GVAR(center)] call CBA_fnc_globalEventJIP; + _id = [QGVAR(broadcastVoice), [GVAR(center), GVAR(currentVoice)], QGVAR(centerVoice_) + hashValue GVAR(center)] call CBA_fnc_globalEventJIP; [_id, GVAR(center)] call CBA_fnc_removeGlobalEventJIP; }; @@ -115,12 +115,11 @@ GVAR(currentVoice) = nil; GVAR(currentInsignia) = nil; GVAR(currentAction) = nil; -GVAR(showStats) = nil; GVAR(currentStatPage) = nil; GVAR(statsInfo) = nil; -GVAR(showActions) = nil; GVAR(currentActionPage) = nil; +GVAR(actionsInfo) = nil; profileNamespace setVariable [QGVAR(favorites), GVAR(favorites)]; GVAR(favoritesOnly) = nil; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index bcc91c133a..f307c932b1 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -68,18 +68,17 @@ if (isNil QGVAR(virtualItems)) then { GVAR(virtualItemsFlatAll) = +GVAR(virtualItemsFlat); GVAR(currentFace) = face GVAR(center); -GVAR(currentVoice) = speaker GVAR(center); +GVAR(currentVoice) = (speaker GVAR(center)) call EFUNC(common,getConfigName); GVAR(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia; GVAR(currentAction) = "Stand"; GVAR(shiftState) = false; -GVAR(showStats) = true; GVAR(currentStatPage) = 0; GVAR(statsInfo) = [true, controlNull, nil, nil]; -GVAR(showActions) = true; GVAR(currentActionPage) = 0; +GVAR(actionsInfo) = [controlNull, nil, nil]; // Update current item list call FUNC(updateCurrentItemsList); diff --git a/addons/arsenal/functions/fnc_onKeyDown.sqf b/addons/arsenal/functions/fnc_onKeyDown.sqf index 24fbd624f6..4d62075f78 100644 --- a/addons/arsenal/functions/fnc_onKeyDown.sqf +++ b/addons/arsenal/functions/fnc_onKeyDown.sqf @@ -147,7 +147,7 @@ if (!isNull _loadoutsDisplay) then { // Right panel lnb + and - buttons case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): { if (GVAR(rightTabLnBFocus)) then { - [_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo); + [_display, parseNumber (_keyPressed != DIK_LEFT)] call FUNC(buttonCargo); }; }; }; diff --git a/addons/arsenal/functions/fnc_onPanelDblClick.sqf b/addons/arsenal/functions/fnc_onPanelDblClick.sqf index 032d87534b..07287d74ce 100644 --- a/addons/arsenal/functions/fnc_onPanelDblClick.sqf +++ b/addons/arsenal/functions/fnc_onPanelDblClick.sqf @@ -27,9 +27,9 @@ private _favorited = false; // Favorites/blacklist will always be lowercase to handle configCase changes private _item = ""; if (_isLnB) then { - _item = toLower (_control lnbData [_curSel, 0]); + _item = toLowerANSI (_control lnbData [_curSel, 0]); } else { - _item = toLower (_control lbData _curSel); + _item = toLowerANSI (_control lbData _curSel); }; if (_item in GVAR(favorites)) then { diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index 3d356fc207..5bf08245c8 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -683,14 +683,19 @@ switch (GVAR(currentLeftPanel)) do { TOGGLE_RIGHT_PANEL_HIDE - private _unitInsigniaConfig = configFile >> "CfgUnitInsignia" >> _item; + // Check for correct config: First mission, then campaign and finally regular config + private _itemCfg = missionConfigFile >> "CfgUnitInsignia" >> _item; + + if (isNull _itemCfg) then { + _itemCfg = campaignConfigFile >> "CfgUnitInsignia" >> _item; + }; + + if (isNull _itemCfg) then { + _itemCfg = configFile >> "CfgUnitInsignia" >> _item; + }; // Display new items's info on the bottom right - if (isNull _unitInsigniaConfig) then { - [_display, _control, _curSel, missionConfigFile >> "CfgUnitInsignia" >> _item] call FUNC(itemInfo); - } else { - [_display, _control, _curSel, _unitInsigniaConfig] call FUNC(itemInfo); - }; + [_display, _control, _curSel, _itemCfg] call FUNC(itemInfo); }; }; diff --git a/addons/arsenal/functions/fnc_refresh.sqf b/addons/arsenal/functions/fnc_refresh.sqf index d40d59c0ff..849b49d16b 100644 --- a/addons/arsenal/functions/fnc_refresh.sqf +++ b/addons/arsenal/functions/fnc_refresh.sqf @@ -25,6 +25,11 @@ if (canSuspend) exitWith { [{_this call FUNC(refresh)}, _this] call CBA_fnc_directCall; }; +private _display = findDisplay IDD_ace_arsenal; + +// Exit quietly if no display found +if (isNull _display) exitWith {}; + if (_updateItems) then { // Update current item list call FUNC(updateCurrentItemsList); @@ -65,6 +70,4 @@ if (!_animate) then { [{GVAR(refreshing) = false}, nil, 3] call CBA_fnc_execAfterNFrames; }; -private _display = findDisplay IDD_ace_arsenal; - [_display, _display displayCtrl GVAR(currentLeftPanel), _animate] call FUNC(fillLeftPanel); diff --git a/addons/arsenal/functions/fnc_removeBox.sqf b/addons/arsenal/functions/fnc_removeBox.sqf index 984db8d099..9fa3ec377a 100644 --- a/addons/arsenal/functions/fnc_removeBox.sqf +++ b/addons/arsenal/functions/fnc_removeBox.sqf @@ -42,8 +42,14 @@ if (_global && {isMultiplayer} && {!isNil "_id"}) then { }; // If the arsenal is already open and not ignoring content (see FUNC(openBox)), close arsenal display -if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object} && {isNil QGVAR(ignoredVirtualItems)}) then { - [LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText); - // Delay a frame in case this is running on display open - [{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame; +// Deliberate == check, fail on objNull +if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object} && {isNil QGVAR(ignoredVirtualItems)}) then { + // Delay a frame in case this is running on display open/close + [{ + private _display = findDisplay IDD_ace_arsenal; + if (isNull _display) exitWith {}; + + [LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText); + _display closeDisplay 0; + }] call CBA_fnc_execNextFrame; }; diff --git a/addons/arsenal/functions/fnc_removeDefaultLoadout.sqf b/addons/arsenal/functions/fnc_removeDefaultLoadout.sqf index e84aad5c04..3ca877f7fd 100644 --- a/addons/arsenal/functions/fnc_removeDefaultLoadout.sqf +++ b/addons/arsenal/functions/fnc_removeDefaultLoadout.sqf @@ -17,8 +17,10 @@ */ params [["_name", "", [""]], ["_global", false, [false]]]; -if (_global) then { - [QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_remoteEvent; +if (_global) exitWith { + private _eventID = format [QGVAR(loadouts_%1), _name]; + [_eventID] call CBA_fnc_removeGlobalEventJIP; + [QGVAR(removeDefaultLoadout), [_name]] call CBA_fnc_globalEvent; }; GVAR(defaultLoadoutsList) deleteAt (GVAR(defaultLoadoutsList) findIf {(_x select 0) == _name}); diff --git a/addons/arsenal/functions/fnc_removeSort.sqf b/addons/arsenal/functions/fnc_removeSort.sqf index 3957257a6d..a5e9fb1d77 100644 --- a/addons/arsenal/functions/fnc_removeSort.sqf +++ b/addons/arsenal/functions/fnc_removeSort.sqf @@ -31,7 +31,7 @@ private _tabToChange = []; _stringCount = count _currentID; // Make sure to keep at least 1 sort per category, so make default sort not deletable - if ("ace_alphabetically" in toLower (_currentID select [0, _stringCount - 3])) then { + if ("ace_alphabetically" in toLowerANSI (_currentID select [0, _stringCount - 3])) then { continue; }; diff --git a/addons/arsenal/functions/fnc_replaceUniqueItemsLoadout.sqf b/addons/arsenal/functions/fnc_replaceUniqueItemsLoadout.sqf index cbbe02666e..061180beaa 100644 --- a/addons/arsenal/functions/fnc_replaceUniqueItemsLoadout.sqf +++ b/addons/arsenal/functions/fnc_replaceUniqueItemsLoadout.sqf @@ -25,7 +25,6 @@ if (count _loadout == 2) then { if (count _loadout != 10) exitWith {[]}; -private _weapon = ""; private _weaponsInfo = []; private _uniqueBaseCfgText = ""; private _cfgWeapons = configFile >> "CfgWeapons"; @@ -43,7 +42,7 @@ private _cfgVehicles = configFile >> "CfgVehicles"; // Check weapon & weapon attachments { - // Magazines + // Magazines in weapons have 2 entries: Name and ammo count if (_forEachIndex in [4, 5]) then { _x params [["_magazine", ""], "_count"]; @@ -69,23 +68,69 @@ private _cfgVehicles = configFile >> "CfgVehicles"; _x params [["_containerClass", ""], ["_items", []]]; if (_containerClass != "") then { - _uniqueBaseCfgText = (getText ([_cfgWeapons, _cfgVehicles] select (_forEachIndex == IDX_LOADOUT_BACKPACK) >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); + if (_forEachIndex == IDX_LOADOUT_BACKPACK) then { + // Check for non-preset first + _uniqueBaseCfgText = [_containerClass, "CfgVehicles"] call CBA_fnc_getNonPresetClass; - if (_uniqueBaseCfgText != "") then { - (_x select 0) set [0, _uniqueBaseCfgText]; + if (_uniqueBaseCfgText != "") then { + _containerClass = _uniqueBaseCfgText; + }; + + // Check if non-preset backpack has a unique base + _uniqueBaseCfgText = (getText (_cfgVehicles >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); + + if (_uniqueBaseCfgText != "") then { + _containerClass = _uniqueBaseCfgText; + }; + + _x set [0, _containerClass]; + } else { + _uniqueBaseCfgText = (getText (_cfgWeapons >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); + + if (_uniqueBaseCfgText != "") then { + _x set [0, _uniqueBaseCfgText]; + }; }; // Check if container has items that need replacing with a defined base { switch (true) do { // Containers have 2 entries: Name and isBackpack - case (_x isEqualTypeArray ["", false]); + case (_x isEqualTypeArray ["", false]): { + _x params ["_containerClass", "_isBackpack"]; + + if (_containerClass != "") then { + if (_isBackpack) then { + // Check for non-preset first + _uniqueBaseCfgText = [_containerClass, "CfgVehicles"] call CBA_fnc_getNonPresetClass; + + if (_uniqueBaseCfgText != "") then { + _containerClass = _uniqueBaseCfgText; + }; + + // Check if non-preset backpack has a unique base + _uniqueBaseCfgText = (getText (_cfgVehicles >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); + + if (_uniqueBaseCfgText != "") then { + _containerClass = _uniqueBaseCfgText; + }; + + _x set [0, _containerClass]; + } else { + _uniqueBaseCfgText = (getText (_cfgWeapons >> _containerClass >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); + + if (_uniqueBaseCfgText != "") then { + _x set [0, _uniqueBaseCfgText]; + }; + }; + }; + }; // Misc. items have 2 entries: Name and amount case (_x isEqualTypeArray ["", 0]): { - _x params ["_item", "_arg"]; + _x params ["_item"]; if (_item != "") then { - _uniqueBaseCfgText = (getText ([_cfgWeapons, _cfgVehicles] select ((_arg isEqualType false) && {_arg}) >> _item >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); + _uniqueBaseCfgText = (getText (_cfgWeapons >> _item >> QGVAR(uniqueBase))) call EFUNC(common,getConfigName); if (_uniqueBaseCfgText != "") then { _x set [0, _uniqueBaseCfgText]; @@ -94,7 +139,7 @@ private _cfgVehicles = configFile >> "CfgVehicles"; }; // Weapons have 2 entries: Weapon info array and amount case (_x isEqualTypeArray [[], 0]): { - _weaponsInfo = _x select 0; + _x params ["_weaponsInfo"]; // Check weapon & weapon attachments { diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf index 8f11b6fc47..fef97e8bd8 100644 --- a/addons/arsenal/functions/fnc_scanConfig.sqf +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -160,7 +160,7 @@ private _magazineMiscItems = createHashMap; { _magazineMiscItems set [configName _x, nil]; -} forEach ((toString {getNumber (_x >> "ACE_isUnique") == 1}) configClasses _cfgMagazines); +} forEach ((toString {getNumber (_x >> "ACE_isUnique") == 1 || getNumber (_x >> "ACE_asItem") == 1}) configClasses _cfgMagazines); // Remove invalid/non-existent entries _grenadeList deleteAt ""; @@ -282,11 +282,42 @@ uiNamespace setVariable [QGVAR(CBAdisposableLaunchers), compileFinal _launchers] uiNamespace setVariable [QGVAR(configItemsTools), compileFinal _toolList]; // Compatibility: Override baseWeapon for RHS optics -// No good way to do this via script for other attachments, needs manual compat +// No good way to do this via script for other RHS attachments, needs manual compat private _baseWeaponCache = uiNamespace getVariable QGVAR(baseWeaponNameCache); { private _baseAttachment = configName (_cfgWeapons >> getText (_x >> "rhs_optic_base")); if (_baseAttachment != "") then { - _baseWeaponCache set [toLower configName _x, _baseAttachment]; + _baseWeaponCache set [toLowerANSI configName _x, _baseAttachment]; }; } forEach ("getText (_x >> 'rhs_optic_base') != ''" configClasses _cfgWeapons); + +// Compatibility: Override baseWeapon for CBA Scripted Optics +// Adapted from https://github.com/Theseus-Aegis/Mods/blob/master/addons/armory/functions/fnc_getBaseVariant.sqf +private _isScriptedOptic = toString { + isClass (_x >> "CBA_ScriptedOptic") || + {(getText (_x >> "weaponInfoType")) regexMatch "CBA_scriptedOptic.*?"} +}; + +{ + private _xClass = toLowerANSI configName _x; + private _baseOptic = _xClass call FUNC(baseOptic); + if (_baseOptic != "" && {_baseOptic != _xClass}) then { + TRACE_2("updating baseOptic",_xClass,_baseOptic); + _baseWeaponCache set [_xClass, _baseOptic]; + }; +} forEach (_isScriptedOptic configClasses _cfgWeapons); + +// Compatibility: Override baseWeapon for CBA Scripted Attachments +private _isScriptedAttachment = toString { + getText (_x >> "MRT_SwitchItemNextClass") != "" || + {getText (_x >> "MRT_SwitchItemPrevClass") != ""} +}; + +{ + private _xClass = toLowerANSI configName _x; + private _baseAttachment = _xClass call FUNC(baseAttachment); + if (_baseAttachment != "" && {_baseAttachment != _xClass}) then { + TRACE_2("updating baseAttachment",_xClass,_baseAttachment); + _baseWeaponCache set [_xClass, _baseAttachment]; + }; +} forEach (_isScriptedAttachment configClasses _cfgWeapons); diff --git a/addons/arsenal/functions/fnc_sortPanel.sqf b/addons/arsenal/functions/fnc_sortPanel.sqf index bbe48d6e35..f9803a429e 100644 --- a/addons/arsenal/functions/fnc_sortPanel.sqf +++ b/addons/arsenal/functions/fnc_sortPanel.sqf @@ -15,6 +15,10 @@ params ["_control"]; +// https://community.bistudio.com/wiki/toString, see comment +// However, using 55295 did not work as expected, 55291 was found by trial and error +#define HIGHEST_VALUE_CHAR 55291 + // When filling the sorting panel, FUNC(sortPanel) is called twice, so ignore first call if (GVAR(ignoreFirstSortPanelCall)) exitWith { GVAR(ignoreFirstSortPanelCall) = false; @@ -29,6 +33,7 @@ private _sortDirectionCtrl = _display displayCtrl ([IDC_sortLeftTabDirection, ID private _cfgMagazines = configFile >> "CfgMagazines"; private _cfgFaces = configFile >> "CfgFaces"; private _cfgUnitInsignia = configFile >> "CfgUnitInsignia"; +private _cfgUnitInsigniaCampaign = campaignConfigFile >> "CfgUnitInsignia"; private _cfgUnitInsigniaMission = missionConfigFile >> "CfgUnitInsignia"; if (_rightSort) then { @@ -126,7 +131,6 @@ private _selected = if (_right) then { _panel lbData _curSel }; -private _originalNames = createHashMap; private _item = ""; private _quantity = ""; private _itemCfg = configNull; @@ -136,12 +140,8 @@ private _fillerChar = toString [1]; private _magazineMiscItems = uiNamespace getVariable QGVAR(magazineMiscItems); private _sortCache = uiNamespace getVariable QGVAR(sortCache); - -private _faceCache = if (_cfgClass == _cfgFaces) then { - uiNamespace getVariable [QGVAR(faceCache), createHashMap] -} else { - createHashMap -}; +private _faceCache = uiNamespace getVariable QGVAR(faceCache); +private _insigniaCache = uiNamespace getVariable QGVAR(insigniaCache); private _countColumns = if (_right) then { count lnbGetColumnsPosition _panel @@ -150,9 +150,9 @@ private _countColumns = if (_right) then { }; private _for = if (_right) then { - for '_i' from 0 to (lnbSize _panel select 0) - 1 + for "_i" from 0 to (lnbSize _panel select 0) - 1 } else { - for '_i' from 0 to (lbSize _panel) - 1 + for "_i" from 0 to (lbSize _panel) - 1 }; _for do { @@ -163,6 +163,14 @@ _for do { _panel lbData _i }; + // Check if entry is "Empty" + if (!_right && {(_panel lbValue _i) == -1}) then { + // Set to lowest/highest lexicographical value, so that "Empty" is always at the top + _panel lbSetTextRight [_i, ["", toString [HIGHEST_VALUE_CHAR, HIGHEST_VALUE_CHAR, HIGHEST_VALUE_CHAR, HIGHEST_VALUE_CHAR, HIGHEST_VALUE_CHAR]] select (_sortDirection == ASCENDING)]; + + continue; + }; + // Get item's count _quantity = if (_right) then { parseNumber (_panel lnbText [_i, 2]) @@ -179,18 +187,22 @@ _for do { _itemCfg = if !(_cfgClass in [_cfgFaces, _cfgUnitInsignia]) then { _cfgClass >> _item } else { - // If insignia, check both config and mission file + // If insignia, check for correct config: First mission, then campaign and finally regular config if (_cfgClass == _cfgUnitInsignia) then { - _itemCfg = _cfgClass >> _item; + _itemCfg = _cfgUnitInsigniaMission >> _item; if (isNull _itemCfg) then { - _itemCfg = _cfgUnitInsigniaMission >> _item; + _itemCfg = _cfgUnitInsigniaCampaign >> _item; + }; + + if (isNull _itemCfg) then { + _itemCfg = _cfgUnitInsignia >> _item; }; _itemCfg } else { // If face, check correct category - _cfgClass >> (_faceCache get _item) param [2, "Man_A3"] >> _item + _cfgClass >> (_faceCache getOrDefault [_item, []]) param [2, "Man_A3"] >> _item }; }; @@ -216,37 +228,29 @@ _for do { _value }, true]; - // Save the current row's item's name in a cache and set text to it's sorting value + // Set the right text temporarily, so it can be used for sorting if (_right) then { - _name = _panel lnbText [_i, 1]; - _originalNames set [_item, _name]; - // Use value, display name and classname to sort, which means a fixed alphabetical order is guaranteed - // Filler char has lowest lexicographical order possible - _panel lnbSetText [[_i, 1], format ["%1%2%4%3", _value, _name, _item, _fillerChar]]; + // Filler char has lowest lexicographical value possible + _panel lnbSetTextRight [[_i, 1], format ["%1%2%4%3", _value, _panel lnbText [_i, 1], _item, _fillerChar]]; } else { if (_item != "") then { - _name = _panel lbText _i; - _originalNames set [_item, _name]; - // Use value, display name and classname to sort, which means a fixed alphabetical order is guaranteed - // Filler char has lowest lexicographical order possible - _panel lbSetText [_i, format ["%1%2%4%3", _value, _name, _item, _fillerChar]]; + // Filler char has lowest lexicographical value possible + _panel lbSetTextRight [_i, format ["%1%2%4%3", _value, _panel lbText _i, _item, _fillerChar]]; }; }; }; -// Sort alphabetically, find the previously selected item, select it again and reset text to original text +// Sort alphabetically, find the previously selected item and select it again if (_right) then { - _panel lnbSort [1, _sortDirection == ASCENDING]; + [_panel, 1] lnbSortBy ["TEXT", _sortDirection == ASCENDING, false, true, true]; // do not support unicode, as it's much more performance intensive (~3x more) _for do { - _item = _panel lnbData [_i, 0]; + // Remove sorting text, as it blocks the item name otherwise + _panel lnbSetTextRight [[_i, 1], ""]; - _panel lnbSetText [[_i, 1], _originalNames get _item]; - - // Set selection after text, otherwise item info box on the right side shows invalid name - if (_curSel != -1 && {_item == _selected}) then { + if (_curSel != -1 && {(_panel lnbData [_i, 0]) == _selected}) then { _panel lnbSetCurSelRow _i; // To avoid unnecessary checks after previsouly selected item was found @@ -254,17 +258,17 @@ if (_right) then { }; }; } else { - lbSort [_panel, ["DESC", "ASC"] select _sortDirection]; + _panel lbSortBy ["TEXT", _sortDirection == ASCENDING, false, true, true]; // do not support unicode, as it's much more performance intensive (~3x more) _for do { _item = _panel lbData _i; // Check if valid item (problems can be caused when searching) if (_item != "") then { - _panel lbSetText [_i, _originalNames get _item]; + // Remove sorting text, as it blocks the item name otherwise + _panel lbSetTextRight [_i, ""]; }; - // Set selection after text, otherwise item info box on the right side shows invalid name if (_curSel != -1 && {_item == _selected}) then { _panel lbSetCurSel _i; diff --git a/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf b/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf index 6da45345f4..df4260ba1a 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf @@ -17,7 +17,7 @@ params ["", "_config"]; TRACE_1("statTextStatement_binoVisionMode",_config); private _text = []; -private _visionModes = getArray (_config >> "visionMode") apply {toLower _x}; +private _visionModes = getArray (_config >> "visionMode") apply {toLowerANSI _x}; { if (_x in _visionModes) then { _text pushBack (localize ([LSTRING(VisionNormal), LSTRING(VisionNight), LSTRING(VisionThermal)] select _forEachIndex)); diff --git a/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf b/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf index b677ec8210..3f982f575c 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_illuminators.sqf @@ -31,9 +31,9 @@ if (_allItems isEqualTo []) then { _allItems = [configName _config] }; || {_illum && {([_xCfg >> "Flashlight" >> "irLight", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1}}; private _text = switch (true) do { // shorthand roughly based on PEQ-15 - case (_laser && _illum): { if (_isIR) then { "IR-DUAL" } else { "VIS-DUAL" } }; - case (_laser): { if (_isIR) then { "IR-AIM" } else { "VIS-AIM" } }; // AIM - case (_illum): { if (_isIR) then { "IR-ILM" } else { "VIS-ILM" } }; // ILLUMIATION + case (_laser && _illum): { ["VIS-DUAL", "IR-DUAL"] select _isIR }; // DUAL + case (_laser): { ["VIS-AIM", "IR-AIM"] select _isIR }; // AIM + case (_illum): { ["VIS-ILM", "IR-ILM"] select _isIR }; // ILLUMIATION default { "_" }; // there are some purely cosmetic attachements }; _allModes pushBackUnique _text; diff --git a/addons/arsenal/functions/fnc_statTextStatement_load.sqf b/addons/arsenal/functions/fnc_statTextStatement_load.sqf new file mode 100644 index 0000000000..032019f582 --- /dev/null +++ b/addons/arsenal/functions/fnc_statTextStatement_load.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Text statement for the load stat. + * + * Arguments: + * 0: Stats + * 1: Item config path + * + * Return Value: + * Stat Text + * + * Public: No +*/ + +params ["_stats", "_config"]; +TRACE_2("statTextStatement_load",_stats,_config); + +if (!isNull (_config >> "ItemInfo" >> "containerClass")) then { // Uniform/Vest + _config = configfile >> "CfgVehicles" >> getText (_config >> "ItemInfo" >> "containerClass"); +}; + +private _load = getNumber (_config >> (_stats # 0)); + +if (_load <= 0) exitWith { LELSTRING(common,none) }; +format ["%1kg (%2lb)", (_load * 0.1 * (1 / 2.2046)) toFixed 2, (_load * 0.1) toFixed 2] diff --git a/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf b/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf index dca83cb381..7348be5bc3 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf @@ -17,7 +17,7 @@ params ["", "_config"]; TRACE_1("statTextStatement_scopeVisionMode",_config); private _opticsModes = ("true" configClasses (_config >> "ItemInfo" >> "OpticsModes")) apply { - private _visionMode = getArray (_x >> "visionMode") apply {toLower _x}; + private _visionMode = getArray (_x >> "visionMode") apply {toLowerANSI _x}; [ getNumber (_x >> "useModelOptics") == 1, // Is in optics _visionMode isEqualTo [], // Optional NVG @@ -67,7 +67,9 @@ if (!_primaryNVGSupported && {(_opticsModes select {_x select 1}) isEqualTo _opt _primaryNVGSupported = true; }; -if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_IntPrim)}; +if (_primaryTiIntegrated && _primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrimTi)}; +if (_primaryTiIntegrated) exitWith {LLSTRING(statVisionMode_ti)}; +if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrim)}; if (_primaryNVGSupported) exitWith {LLSTRING(statVisionMode_supPrim)}; if (_secondaryNVGSupported) exitWith {LLSTRING(statVisionMode_supSec)}; diff --git a/addons/arsenal/functions/fnc_updateCurrentItemsList.sqf b/addons/arsenal/functions/fnc_updateCurrentItemsList.sqf index 0b1af5d465..0dcf3866b9 100644 --- a/addons/arsenal/functions/fnc_updateCurrentItemsList.sqf +++ b/addons/arsenal/functions/fnc_updateCurrentItemsList.sqf @@ -63,8 +63,12 @@ private _indexCurrentItems = -1; }; // Backpack case IDX_LOADOUT_BACKPACK: { - GVAR(currentItems) set [IDX_CURR_BACKPACK, _x param [0, ""]]; - GVAR(currentItems) set [IDX_CURR_BACKPACK_ITEMS, _x param [1, []]]; + _x params [["_backpack", ""], ["_items", []]]; + if (_backpack != "") then { + _backpack = [_backpack, "CfgVehicles"] call CBA_fnc_getNonPresetClass; + }; + GVAR(currentItems) set [IDX_CURR_BACKPACK, _backpack]; + GVAR(currentItems) set [IDX_CURR_BACKPACK_ITEMS, _items]; }; // Helmet case IDX_LOADOUT_HEADGEAR: { diff --git a/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf b/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf index fddc9b3b9c..9b7eb6327a 100644 --- a/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf +++ b/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf @@ -101,6 +101,11 @@ private _fnc_uniqueEquipment = { case IDX_LOADOUT_BACKPACK: { _x params [["_containerClass", ""]]; + // Handle preset (loaded/AI) backpacks + if (_containerClass != "" && _forEachIndex == IDX_LOADOUT_BACKPACK) then { + _containerClass = [_containerClass, "CfgVehicles"] call CBA_fnc_getNonPresetClass; + }; + // Remove all unique equipment in tab; Add container as a unique equipment [GVAR(virtualItems) get (_forEachIndex + 1), _containerClass] call _fnc_uniqueEquipment; }; diff --git a/addons/arsenal/functions/fnc_verifyLoadout.sqf b/addons/arsenal/functions/fnc_verifyLoadout.sqf index b5425c2117..10cd9a2553 100644 --- a/addons/arsenal/functions/fnc_verifyLoadout.sqf +++ b/addons/arsenal/functions/fnc_verifyLoadout.sqf @@ -13,289 +13,97 @@ * Public: No */ +#define NOT_IN_ARSENAL !(_name in GVAR(virtualItemsFlat)) + params ["_loadout"]; private _extendedInfo = createHashMap; // Check if the provided loadout is a CBA extended loadout if (count _loadout == 2) then { - _extendedInfo = _loadout select 1; + _extendedInfo = +(_loadout select 1); // Copy the hashmap to prevent events from modifiyng the profileNamespace extendedInfo + if (_extendedInfo isEqualType []) then { // Hashmaps are serialized as arrays, convert back to hashmap + _extendedInfo = createHashMapFromArray _extendedInfo; + _loadout set [1, _extendedInfo]; // Also fix source variable, technically not needed but doesn't hurt + }; _loadout = _loadout select 0; }; -private _cfgWeapons = configFile >> "CfgWeapons"; -private _cfgMagazines = configFile >> "CfgMagazines"; -private _cfgVehicles = configFile >> "CfgVehicles"; -private _cfgGlasses = configFile >> "CfgGlasses"; - -private _weapons = GVAR(virtualItems) get IDX_VIRT_WEAPONS; -private _attachments = GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS; - private _name = ""; -private _nullItemsAmount = 0; -private _unavailableItemsAmount = 0; +private _itemArray = []; private _nullItemsList = []; private _unavailableItemsList = []; +private _missingExtendedInfo = []; -// Search for all items and turn them into config case; Don't touch other value types -private _fnc_toConfigCase = { +// Search for all items and check their availability +private _fnc_filterLoadout = { _this apply { - if (_x isEqualType "") then { - if (_x != "") then { - _name = _x call EFUNC(common,getConfigName); + if (_x isEqualType "" && {_x != ""}) then { + _name = _x call EFUNC(common,getConfigName); - // If item doesn't exist in config, "" is returned - // Just return unaltered item name in that case, so it can be documented as being unavailable - if (_name != "") then { - _name - } else { - _x - }; + // If item doesn't exist in config, "" is returned + if (_name == "") then { + _nullItemsList pushBack _x; } else { - _x + // Check if item or its base weapon exist in the arsenal + if NOT_IN_ARSENAL then { + _name = _name call FUNC(baseWeapon); + if NOT_IN_ARSENAL then { + // This could be a backpack + private _temp = [_name, "CfgVehicles"] call CBA_fnc_getNonPresetClass; + if (_temp == "") then { // It's not + _unavailableItemsList pushBack _name; + _name = ""; + } else { // It is + _name = _temp; + // Check if it's available again + if NOT_IN_ARSENAL then { + _unavailableItemsList pushBack _name; + _name = ""; + }; + }; + }; + }; }; + + _name } else { // Handle arrays if (_x isEqualType []) then { - _x call _fnc_toConfigCase + _itemArray = _x call _fnc_filterLoadout; + // If "" is given as a container, an error is thrown, therefore, filter out all unavailable/null containers + if (count _itemArray == 2 && {(_itemArray select 0) isEqualTo ""} && {(_itemArray select 1) isEqualType []}) then { + _itemArray = []; + }; + _itemArray } else { - // All other types + // All other types and empty strings _x }; }; }; }; -// Convert loadout to config case +// Convert loadout to config case and replace null/unavailable items // Loadout might come from a different modpack, which might have different config naming -_loadout = _loadout call _fnc_toConfigCase; +_loadout = _loadout call _fnc_filterLoadout; -// Check a weapon, with its attachments and magazines, if items are available -private _fnc_weaponCheck = { - params ["_weaponArray", ["_index", -1]]; +{ + private _class = _extendedInfo getOrDefault [_x, ""]; + private _cache = missionNamespace getVariable (_x + "Cache"); - { - // Weapons and attachments - if (_x isEqualType "") then { - if (_x != "") then { - // Check if item exists - if (isClass (_cfgWeapons >> _x)) then { - // Get base weapon - _x = _x call FUNC(baseWeapon); - - // Check if item is available in arsenal - if !( - // Weapon class name is at the very start of the array - if (_forEachIndex == 0) then { - // If the type of weapon is known, only look through that array - if (_index != -1) then { - // If binos, choose differently - if (_index == IDX_LOADOUT_BINO) then { - _x in (GVAR(virtualItems) get IDX_VIRT_BINO) - } else { - _x in (_weapons get _index) - }; - } else { - _x in (_weapons get IDX_VIRT_PRIMARY_WEAPONS) || - {_x in (_weapons get IDX_VIRT_SECONDARY_WEAPONS)} || - {_x in (_weapons get IDX_VIRT_HANDGUN_WEAPONS)} || - {_x in (GVAR(virtualItems) get IDX_VIRT_BINO)} - }; - } else { - _x in (_attachments get IDX_VIRT_OPTICS_ATTACHMENTS) || - {_x in (_attachments get IDX_VIRT_FLASHLIGHT_ATTACHMENTS)} || - {_x in (_attachments get IDX_VIRT_MUZZLE_ATTACHMENTS)} || - {_x in (_attachments get IDX_VIRT_BIPOD_ATTACHMENTS)} - } - ) then { - _unavailableItemsList pushBackUnique _x; - _weaponArray set [_forEachIndex, ""]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _x; - _weaponArray set [_forEachIndex, ""]; - INC(_nullItemsAmount); - }; - }; - } else { - // Magazines - if (_x isNotEqualTo []) then { - _x params ["_magazine"]; - - // Check if item exists - if (isClass (_cfgMagazines >> _magazine)) then { - // Check if item is available in arsenal - if !(_magazine in (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL)) then { - _unavailableItemsList pushBackUnique _magazine; - _weaponArray set [_forEachIndex, []]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _magazine; - _weaponArray set [_forEachIndex, []]; - INC(_nullItemsAmount); - }; - }; - }; - } forEach _weaponArray; -}; - -private _item = ""; - -// Go through entire loadout to check if items are available in current arsenal -for "_dataIndex" from IDX_LOADOUT_PRIMARY_WEAPON to IDX_LOADOUT_ASSIGNEDITEMS do { - switch (_dataIndex) do { - // Primary weapon, Secondary weapon, Handgun weapon, Binoculars - case IDX_LOADOUT_PRIMARY_WEAPON; - case IDX_LOADOUT_SECONDARY_WEAPON; - case IDX_LOADOUT_HANDGUN_WEAPON; - case IDX_LOADOUT_BINO: { - [_loadout select _dataIndex, _dataIndex] call _fnc_weaponCheck; - }; - // Uniform, vest, backpack - case IDX_LOADOUT_UNIFORM; - case IDX_LOADOUT_VEST; - case IDX_LOADOUT_BACKPACK: { - (_loadout select _dataIndex) params [["_item", ""], ["_containerItems", []]]; - - if (_item != "") then { - // Check if item exists - if (isClass (_cfgVehicles >> _item) || {isClass (_cfgWeapons >> _item)}) then { - // Check if item is available in arsenal - if !(_item in (GVAR(virtualItems) get (_dataIndex + 1))) then { - _unavailableItemsList pushBackUnique _item; - _loadout set [_dataIndex, []]; - INC(_unavailableItemsAmount); - } else { - { - switch (true) do { - // Magazines have each 3 entries: Name, number of magazines and ammo count - case (_x isEqualTypeArray ["", 0, 0]): { - _x params ["_item"]; - - // Check if item exists - if (isClass (_cfgMagazines >> _item)) then { - // Check if item is available in arsenal - if !( - _item in (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL) || - {_item in (GVAR(virtualItems) get IDX_VIRT_GRENADES)} || - {_item in (GVAR(virtualItems) get IDX_VIRT_EXPLOSIVES)} || - {_item in (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS)} - ) then { - _unavailableItemsList pushBackUnique _item; - ((_loadout select _dataIndex) select 1) set [_forEachIndex, []]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _item; - ((_loadout select _dataIndex) select 1) set [_forEachIndex, []]; - INC(_nullItemsAmount); - }; - }; - // Weapons have 2 entries: Weapon info array and amount - case (_x isEqualTypeArray [[], 0]): { - [_x select 0] call _fnc_weaponCheck; - }; - // Misc. items have 2 entries: Name and amount, containers have 2 entries: Name and isBackpack - default { - _x params ["_item"]; - - // Check if item exists - if ( - isClass (_cfgWeapons >> _item) || - {isClass (_cfgMagazines >> _item)} || - {isClass (_cfgGlasses >> _item)} || - {isClass (_cfgVehicles >> _item)} - ) then { - // Check if item is available in arsenal - if !(_item in GVAR(virtualItemsFlat)) then { - _unavailableItemsList pushBackUnique _item; - ((_loadout select _dataIndex) select 1) set [_forEachIndex, []]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _item; - ((_loadout select _dataIndex) select 1) set [_forEachIndex, []]; - INC(_nullItemsAmount); - }; - }; - - }; - } forEach _containerItems; - }; - } else { - _nullItemsList pushBackUnique _item; - _loadout set [_dataIndex, []]; - INC(_nullItemsAmount); - }; - }; - }; - // Headgear - case IDX_LOADOUT_HEADGEAR: { - _item = _loadout select _dataIndex; - - if (_item != "") then { - // Check if item exists - if (isClass (_cfgWeapons >> _item)) then { - // Check if item is available in arsenal - if !(_item in (GVAR(virtualItems) get IDX_VIRT_HEADGEAR)) then { - _unavailableItemsList pushBackUnique _item; - _loadout set [_dataIndex, ""]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _item; - _loadout set [_dataIndex, ""]; - INC(_nullItemsAmount); - }; - }; - }; - // Facewear - case IDX_LOADOUT_GOGGLES: { - _item = _loadout select _dataIndex; - - if (_item != "") then { - // Check if item exists - if (isClass (_cfgGlasses >> _item)) then { - // Check if item is available in arsenal - if !(_item in (GVAR(virtualItems) get IDX_VIRT_GOGGLES)) then { - _unavailableItemsList pushBackUnique _item; - _loadout set [_dataIndex, ""]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _item; - _loadout set [_dataIndex, ""]; - INC(_nullItemsAmount); - }; - }; - }; - // Assigned items: Map, Compass, Watch, GPS / UAV Terminal, Radio, NVGs - case IDX_LOADOUT_ASSIGNEDITEMS: { - private _assignedItems = _loadout select _dataIndex; - - for "_subIndex" from 0 to 5 do { - _item = _assignedItems select _subIndex; - - if (_item != "") then { - // Check if item exists - if (isClass (_cfgWeapons >> _item)) then { - // Check if item is available in arsenal - if !(_item in (GVAR(virtualItems) get (IDX_VIRT_NVG + ([2, 6, 4, 3, 5, 0] select _subIndex)))) then { - _unavailableItemsList pushBackUnique _item; - _assignedItems set [_subIndex, ""]; - INC(_unavailableItemsAmount); - }; - } else { - _nullItemsList pushBackUnique _item; - _assignedItems set [_subIndex, ""]; - INC(_nullItemsAmount); - }; - }; - }; - }; + // Previously voices were stored in lower case (speaker command returns lower case), so this is to make old loadouts compatible + if (_class != "" && {_x == QGVAR(voice)}) then { + _class = _class call EFUNC(common,getConfigName); }; -}; + if (_class != "" && {!(_class in _cache)}) then { + _missingExtendedInfo pushBack [_x, _class]; + _extendedInfo deleteAt _x; + }; +} forEach [QGVAR(insignia), QGVAR(face), QGVAR(voice)]; -[[_loadout, _extendedInfo], _nullItemsAmount, _unavailableItemsAmount, _nullItemsList, _unavailableItemsList] +// Raise event for 3rd party: mostly for handling extended info +// Pass all items, including duplicates +[QGVAR(loadoutVerified), [_loadout, _extendedInfo, _nullItemsList, _unavailableItemsList, _missingExtendedInfo]] call CBA_fnc_localEvent; + +[[_loadout, _extendedInfo], _nullItemsList arrayIntersect _nullItemsList, _unavailableItemsList arrayIntersect _unavailableItemsList, _missingExtendedInfo] diff --git a/addons/arsenal/script_component.hpp b/addons/arsenal/script_component.hpp index 0f7348b9db..2eb9c3f170 100644 --- a/addons/arsenal/script_component.hpp +++ b/addons/arsenal/script_component.hpp @@ -15,6 +15,3 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" - -#define ACTION_TYPE_BUTTON 0 -#define ACTION_TYPE_TEXT 1 diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 7f6947d913..02c35266db 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -613,7 +613,7 @@ Le set d'équipement suivant a été supprimé : Folgende Ausrüstung wurde entfernt: Następujący zestaw został skasowany: - 次の装備は削除されました: + 装備を削除しました: Il seguente equipaggiamento è stato eliminato: 다음 로드아웃이 삭제됨 : 以下的裝備已被刪除: @@ -629,7 +629,7 @@ Le set d'équipement suivant n'est plus public : Folgende Ausrüstung ist nicht mehr öffentlich: Następujący zestaw nie jest już publiczny: - 次の装備は非公開になりました: + 装備を非公開にしました: Il seguente equipaggiamento non è più pubblico: 다음 로드아웃이 더이상 공용이 아님: 以下的裝備已不再被分享: @@ -645,7 +645,7 @@ Le champ "nom" est vide ! Das Feld "Name" ist leer! Pole nazwy jest puste! - 名前が空白です! + 名前が空欄です! Il campo del nome è vuoto! 이름칸이 비었습니다! 名稱欄位為空! @@ -677,7 +677,7 @@ Un de vos sets d'équipement ayant le même nom est public. Eine deiner Ausrüstungen mit dem gleichen Namen ist öffentlich Jeden z Twoich zestawów nazwany tak samo jest już publiczny - あなたの装備は既に公開されているものと同名です + あなたのものと同じ名前の装備が既に公開されています Un tuo equipaggiamento con lo stesso nome è pubblico 같은 이름의 로드아웃이 공용에 있습니다. 已有相同名稱的裝備在公用分享區 @@ -693,7 +693,7 @@ Le set d'équipement suivant a été enregistré : Folgende Ausrüstung wurde gespeichert: Następujący zestaw został zapisany: - 次の装備は保存されました: + 装備を保存しました: Il seguente equipaggiamento è stato salvato: 다음 로드아웃이 저장됨: 以下的裝備已被保存: @@ -709,7 +709,7 @@ Le set d'équipement suivant a été chargé : Folgene Ausrüstung wurde geladen: Następujący zestaw został wczytany: - 次の装備が読み込みされました: + 装備を読み込みました: Il seguente equipaggiamento è stato caricato: 다음 로드아웃을 불러옴: 以下的裝備已被載入: @@ -725,7 +725,7 @@ Un set d'équipement ayant le même nom existe déjà ! Eine Ausrüstung mit dem gleichen Namen existiert bereits! Zestaw z tą nazwą już istnieje! - 既にその名前は装備に使われています! + 既に同じ名前の装備が存在しています! Un equipaggiamento con lo stesso nome è gia esistente! 같은 이름의 로드아웃이 이미 존재합니다! 已有相同名稱的裝備! @@ -741,7 +741,7 @@ a été renommé en wurde umbenannt in zmienił nazwę na - 次の名前に変更されました + を次の名前に変更しました: È stato rinominato in 이름이 다음과 같이 변경됨: 已被改名為 @@ -1181,7 +1181,7 @@ Nightvision Support Soporte de visión nocturna Nachtsicht Unterstützung - 暗視装置への対応有無 + 暗視装置への対応 Wsparcie noktowizyjne Supporto visore notturno Поддержка ночного видения @@ -1191,7 +1191,7 @@ 支持夜视仪 Podpora nočního vidění Gece Görüş Desteği - 야간투시 지원여부 + 야간투시 지원 Primary supported @@ -1206,7 +1206,7 @@ 主武器支援 主镜支持 Hlavní část hledí podporuje - 주무기 지원여부 + 주무기 지원 Secondary supported @@ -1221,9 +1221,9 @@ 次要武器支援 副镜支持 Vedlejší část hledí podporuje - 보조무기 지원여부 + 보조무기 지원 - + Primary integrated Primaria integrada Primär Integriert @@ -1236,7 +1236,23 @@ 整合主武器 主镜内置 Integrováno do hlavní části hledí - 주무기 내장여부 + 주무기 내장 + + + Thermal integrated + Termico integrato + 熱画像装置内蔵 + Интегрирован тепловизор. + 열화상 내장 + Thermique intégrée + + + Thermal & Primary integrated + Termico e Primario integrato + 熱画像装置内蔵・プライマリに内蔵 + Интегрирован тепловизор и осн.прицел. + 열화상과 주무기 내장 + Thermique et primaire intégrés Not Supported @@ -1257,7 +1273,7 @@ Vision Mode Sichtmodus - ビジョン モード + 映像モード Modalità Visiva 視覺模式 视觉模式 @@ -1495,7 +1511,7 @@ Añade automáticamente accesorios o cargadores (de la categoría seleccionada) a todas las armas de la lista de objetos Es werden automatisch kompatible Aufsätze oder Magazine für alle ausgewählten Waffen hinzugefügt Automatycznie doda kompatybilne dodatki oraz magazynki (odpowiednio do każdej kategorii) dla wszystkich broni na liście - 現在のアイテムリスト内にある全武器に対応する アタッチメントと弾倉(選択したカテゴリに基づく)を自動的に追加します + 現在のアイテムリスト内の全武器に対応する アタッチメントと弾倉(選択したカテゴリに基づく)を自動的に追加します Добавляет совместимые приспособления или магазины (в зависимости от выбранной категории) для всего оружия в текущем списке предметов Irá automaticamente adicionar acessórios ou carregadores (baseado na categoria selecionada) para todas as armas na lista de itens atual Ajoute automatiquement des accessoires ou des chargeurs compatibles (en fonction de la catégorie sélectionnée), pour toutes les armes de la liste actuelle. @@ -1592,6 +1608,7 @@ 내림차순 Décroissant Decrescente + Нисходящий Ascending @@ -1602,6 +1619,7 @@ 오름차순 Croissant Crescente + Восходящий Tools @@ -1628,6 +1646,7 @@ 장탄 수 Nombre de munitions Quantidade de munição + Количество боеприпасов Illuminators @@ -1637,6 +1656,7 @@ 조명 Iluminadores イルミネーター + Осветители Default to Favorites @@ -1647,6 +1667,7 @@ 즐겨찾기 기본값 Favoris par défaut Favoritos por padrão + По умолчанию - Избранное Controls whether the ACE Arsenal defaults to showing all items or favorites. @@ -1657,6 +1678,7 @@ ACE 아스널이 기본적으로 모든 아이템 또는 즐겨찾기를 표시할 지 여부를 조정합니다. Contrôle si l'arsenal ACE affiche par défaut tous les éléments ou les favoris. Controla se o Arsenal ACE exibe por padrão todos os itens ou favoritos. + Определяет, будет ли в арсенале ACE по умолчанию отображаться все предметы или избранное. Favorites Color @@ -1667,6 +1689,7 @@ 즐겨찾기 색상 Couleurs favorites Cor dos favoritos + Избранный цвет Highlight color for favorited items. @@ -1677,6 +1700,7 @@ 즐겨찾기한 아이템을 색상으로 강조합니다. Met en surbrillance les éléments favoris. Cor de destaque para itens favoritados. + Выделите цветом любимые предметы. Switch between displaying all items or your favorites.\nDouble click while holding Shift to add or remove an item. @@ -1687,6 +1711,7 @@ 모든 아이템을 표시하거나 즐겨찾기를 표시할 때 전환합니다\nShift 키를 누른 상태에서 두 번 클릭하여 아이템을 추가하거나 제거합니다. Change entre l'affichage de tous les éléments ou de vos favoris.\nDouble-cliquez en maintenant la touche Maj enfoncée pour ajouter ou supprimer un élément. Alterna entre a exibição de todos os itens ou seus favoritos.\nClique duas vezes enquanto mantém pressionada a tecla Shift para adicionar ou remover um item. + Переключайтесь между отображением всех элементов или ваших избранных.\nДважды щелкните, удерживая Shift, чтобы добавить или удалить элемент. Search\nCTRL + Click to enable live results @@ -1694,6 +1719,8 @@ Cerca\nCTRL + Click per modificare i risultati mentre scrivi 検索\nCTRL + クリックで検索結果の即時表示を有効化 검색\nCtrl + 클릭으로 실시간 검색 결과를 활성화 + Поиск\nCtrl + Click для включения результатов в реальном времени + Recherche\nCTRL + clic pour modifier les résultats tout en écrivant diff --git a/addons/arsenal/ui/RscAttributes.hpp b/addons/arsenal/ui/RscAttributes.hpp index 0265e86f3f..dc70caa0c2 100644 --- a/addons/arsenal/ui/RscAttributes.hpp +++ b/addons/arsenal/ui/RscAttributes.hpp @@ -450,24 +450,23 @@ class GVAR(display) { h = QUOTE(55 * GRID_H); class controls { class actionsStaticBackground1: ctrlStaticBackground { - idc = -1; + idc = IDC_actionsBackground1; x = QUOTE(0); y = QUOTE(0); w = QUOTE(47 * GRID_W); - h = QUOTE(56 * GRID_H); + h = QUOTE(55 * GRID_H); colorBackground[]={0.1,0.1,0.1,0.5}; }; class actionsStaticBackground2: ctrlStaticBackground { - idc = -1; + idc = IDC_actionsBackground2; x = QUOTE(0); y = QUOTE(0); w = QUOTE(47 * GRID_W); h = QUOTE(5 * GRID_H); colorBackground[]={0.1,0.1,0.1,0.8}; }; - class actionsText1: RscText { + class actionsText1: RscTextMulti { idc = IDC_actionsText1; - fade = 1; x = QUOTE(0 * GRID_W); y = QUOTE(5 * GRID_H); w = QUOTE(45 * GRID_W); @@ -479,7 +478,6 @@ class GVAR(display) { }; class actionsButton1: ctrlButton { idc = IDC_actionsButton1; - fade = 1; text = ""; x = QUOTE(1 * GRID_W); y = QUOTE(6 * GRID_H); @@ -566,6 +564,7 @@ class GVAR(display) { colorSelect[] = {1,1,1,1}; colorSelect2[] = {1,1,1,1}; colorPictureRightSelected[] = {1,1,1,1}; + colorTextRight[] = {0.5, 0.5, 0.5, 0}; onLBSelChanged = QUOTE(_this call FUNC(onSelChangedLeft)); onLBDblClick = QUOTE(_this call FUNC(onPanelDblClick)); onSetFocus = QUOTE(GVAR(leftTabFocus) = true); @@ -596,6 +595,7 @@ class GVAR(display) { colorSelect[] = {1,1,1,1}; colorSelect2[] = {1,1,1,1}; colorPictureRightSelected[] = {1,1,1,1}; + colorTextRight[] = {0.5, 0.5, 0.5, 0}; columns[] = {0.07, 0.15, 0.75}; idcLeft = IDC_arrowMinus; idcRIght = IDC_arrowPlus; diff --git a/addons/arsenal/ui/script_component.hpp b/addons/arsenal/ui/script_component.hpp deleted file mode 100644 index fcf9da9867..0000000000 --- a/addons/arsenal/ui/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "..\script_component.hpp" diff --git a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf index 97c8dfe435..327a2903a0 100644 --- a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf @@ -65,7 +65,7 @@ GVAR(magModeData) = []; { _x params ["_xDisplayNameShort", "_xDisplayName", "_xInitSpeed", "_xAirFriction"]; if (_allSameCharge) then { - _ctrlChargeList lbAdd format ["%1", _xDisplayNameShort]; + _ctrlChargeList lbAdd _xDisplayNameShort; _ctrlChargeList lbSetTooltip [count GVAR(magModeData), format ["%1\n%2 m/s\n%3", _xDisplayName, _xInitSpeed toFixed 1, _xAirFriction]]; GVAR(magModeData) pushBack [_xInitSpeed, _xAirFriction]; } else { diff --git a/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf b/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf index 56135025ae..3e50f9d7ad 100644 --- a/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableUpdate.sqf @@ -22,10 +22,10 @@ private _ctrlElevationHigh = _dialog displayCtrl IDC_BUTTON_ELEV_HIGH; private _ctrlElevationLow = _dialog displayCtrl IDC_BUTTON_ELEV_LOW; GVAR(lastElevationMode) = param [0, GVAR(lastElevationMode)]; // update if passed a new value -GVAR(lastCharge) = lbCurSel _ctrlChargeList; +GVAR(lastTablePage) = lbCurSel _ctrlChargeList; // get data for currently selected mag/mode combo: -(GVAR(magModeData) select GVAR(lastCharge)) params [["_muzzleVelocity", -1], ["_airFriction", 0]]; +(GVAR(magModeData) select GVAR(lastTablePage)) params [["_muzzleVelocity", -1], ["_airFriction", 0]]; private _elevMin = _dialog getVariable [QGVAR(elevMin), 0]; private _elevMax = _dialog getVariable [QGVAR(elevMax), 0]; _ctrlElevationHigh ctrlSetTextColor ([[0.25,0.25,0.25,1],[1,1,1,1]] select GVAR(lastElevationMode)); diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 62d45555b1..01eb14d928 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -1,8 +1,10 @@ #include "script_component.hpp" +if (!hasInterface) exitWith {}; + #include "initKeybinds.inc.sqf" GVAR(active) = false; GVAR(initialised) = false; -[QEGVAR(vector,rangefinderData), {_this call FUNC(sord)}] call CBA_fnc_addEventHandler; +[QEGVAR(vector,rangefinderData), LINKFUNC(sord)] call CBA_fnc_addEventHandler; diff --git a/addons/atragmx/functions/fnc_initGunList.sqf b/addons/atragmx/functions/fnc_initGunList.sqf index 783a68202a..2ae67bb78d 100644 --- a/addons/atragmx/functions/fnc_initGunList.sqf +++ b/addons/atragmx/functions/fnc_initGunList.sqf @@ -15,7 +15,7 @@ * Public: No */ -LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]", profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion), 'none')], count (profileNamespace getVariable [ARR_2(QGVAR(gunList), [])])); +LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]",profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion),'none')],count (profileNamespace getVariable [ARR_2(QGVAR(gunList),[])])); private _resetGunList = true; if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && {count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0}) then { diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index 4def2f87a6..cfd8f460a9 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -90,7 +90,7 @@ if (GVAR(showWind2)) then { _elevationAbs = Round(_elevationAbs * 100) / 100; if (_elevationAbs > 0) then { - ctrlSetText [400, format["%1", abs(_elevationAbs)]]; + ctrlSetText [400, str abs _elevationAbs]; } else { if (_elevationAbs < 0) then { ctrlSetText [400, format["%1D", abs(_elevationAbs)]]; @@ -100,7 +100,7 @@ if (_elevationAbs > 0) then { }; _elevationRel = Round(_elevationRel * 100) / 100; if (_elevationRel > 0) then { - ctrlSetText [401, format["%1", abs(_elevationRel)]]; + ctrlSetText [401, str abs _elevationRel]; } else { if (_elevationRel < 0) then { ctrlSetText [401, format["%1D", abs(_elevationRel)]]; @@ -110,7 +110,7 @@ if (_elevationRel > 0) then { }; _elevationCur = Round(_elevationCur * 100) / 100; if (_elevationCur > 0) then { - ctrlSetText [402, format["%1", abs(_elevationCur)]]; + ctrlSetText [402, str abs _elevationCur]; } else { if (_elevationCur < 0) then { ctrlSetText [402, format["%1D", abs(_elevationCur)]]; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index ec87f96dd0..d953b02bd1 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -57,7 +57,7 @@ if (!_isChemlight) then { _unit addItem _itemName; }; -if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then { +if (toLowerANSI _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then { // Hack for dealing with X_IR_Grenade effect not dissapearing on deleteVehicle detach _attachedObject; _attachedObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]); diff --git a/addons/ballistics/functions/fnc_statTextStatement_magazineMuzzleVelocity.sqf b/addons/ballistics/functions/fnc_statTextStatement_magazineMuzzleVelocity.sqf index 701ce544f7..a57a52bba7 100644 --- a/addons/ballistics/functions/fnc_statTextStatement_magazineMuzzleVelocity.sqf +++ b/addons/ballistics/functions/fnc_statTextStatement_magazineMuzzleVelocity.sqf @@ -41,7 +41,11 @@ if (_initSpeedCoef > 0) then { }; private _abAdjustText = ""; -if (_magIsForCurrentWeapon && {["ace_advanced_ballistics"] call EFUNC(common,isModLoaded)}) then { +if ( + _magIsForCurrentWeapon && + {missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]} && + {missionNamespace getVariable [QEGVAR(advanced_ballistics,barrelLengthInfluenceEnabled), false]} // this can be on while AB is off or vice-versa +) then { private _configAmmo = (configFile >> "CfgAmmo" >> (getText (_configMagazine >> "ammo"))); private _barrelLength = getNumber (_configWeapon >> "ACE_barrelLength"); private _muzzleVelocityTable = getArray (_configAmmo >> "ACE_muzzleVelocities"); diff --git a/addons/ballistics/functions/fnc_statTextStatement_weaponMuzzleVelocity.sqf b/addons/ballistics/functions/fnc_statTextStatement_weaponMuzzleVelocity.sqf index 16ab9e2a47..e11c7cf5fb 100644 --- a/addons/ballistics/functions/fnc_statTextStatement_weaponMuzzleVelocity.sqf +++ b/addons/ballistics/functions/fnc_statTextStatement_weaponMuzzleVelocity.sqf @@ -37,7 +37,10 @@ if (_magazine isEqualTo "") then { }; private _abAdjustText = ""; - if (["ace_advanced_ballistics"] call EFUNC(common,isModLoaded)) then { + if ( + missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && + {missionNamespace getVariable [QEGVAR(advanced_ballistics,barrelLengthInfluenceEnabled), false]} // this can be on while AB is off or vice-versa + ) then { private _configAmmo = (configFile >> "CfgAmmo" >> (getText (_configMagazine >> "ammo"))); private _barrelLength = getNumber (_configWeapon >> "ACE_barrelLength"); private _muzzleVelocityTable = getArray (_configAmmo >> "ACE_muzzleVelocities"); diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 40385e9680..aa746e543f 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -3539,6 +3539,7 @@ 인공지능 사용 Utilisation de l'IA Utilização por IA + Использование ИИ Illum @@ -3549,6 +3550,7 @@ 조명탄 Fusées éclairantes Sinalizadoras + Осветители Smoke @@ -3559,6 +3561,7 @@ 연막탄 Fumigènes Fumígenas + Дым Inf @@ -3569,6 +3572,7 @@ 보병 Infanterie Infantaria + Пехота Veh @@ -3579,6 +3583,7 @@ 차량 Véhicule Veículo + Техника Armor @@ -3589,6 +3594,7 @@ 기갑 Blindage Blindagem + Бронетехника Air @@ -3599,6 +3605,7 @@ 항공 Aviation Aeronaves + Авиация diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 8d34c4fb40..951a710771 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -25,14 +25,14 @@ if (isServer) then { }; ["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; -[QGVAR(moveInCaptive), FUNC(vehicleCaptiveMoveIn)] call CBA_fnc_addEventHandler; -[QGVAR(moveOutCaptive), FUNC(vehicleCaptiveMoveOut)] call CBA_fnc_addEventHandler; +[QGVAR(moveInCaptive), LINKFUNC(vehicleCaptiveMoveIn)] call CBA_fnc_addEventHandler; +[QGVAR(moveOutCaptive), LINKFUNC(vehicleCaptiveMoveOut)] call CBA_fnc_addEventHandler; -[QGVAR(setHandcuffed), FUNC(setHandcuffed)] call CBA_fnc_addEventHandler; -[QGVAR(setSurrendered), FUNC(setSurrendered)] call CBA_fnc_addEventHandler; +[QGVAR(setHandcuffed), LINKFUNC(setHandcuffed)] call CBA_fnc_addEventHandler; +[QGVAR(setSurrendered), LINKFUNC(setSurrendered)] call CBA_fnc_addEventHandler; //Medical Integration Events -["ace_unconscious", FUNC(handleOnUnconscious)] call CBA_fnc_addEventHandler; +["ace_unconscious", LINKFUNC(handleOnUnconscious)] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; diff --git a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf index 4341867b29..2e07a353df 100644 --- a/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf +++ b/addons/captives/functions/fnc_findEmptyNonFFVCargoSeat.sqf @@ -16,7 +16,7 @@ */ params ["_vehicle"]; -TRACE_1("params", _vehicle); +TRACE_1("params",_vehicle); scopeName "main"; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 1527038ce9..a43207fc84 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -27,7 +27,7 @@ if (_isUnconc) then { }; } else { //Woke up: if handcuffed, goto animation - if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { + if (_unit getVariable [QGVAR(isHandcuffed), false] && {isNull objectParent _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index c12a02a574..174022ea11 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -145,6 +145,7 @@ Załóż opaskę na oczy 포로 눈 가리기 目隠しをする + Завязать глаза пленному Remove blindfold @@ -154,6 +155,7 @@ Zdejmij opaskę z oczu 눈가리개 풀기 目隠しを外す + Снять повязку с глаз Cable Tie @@ -484,7 +486,7 @@ 设置在光标下的单位成俘虏状态。 커서의 병력을 포박합니다. Ustawia jednostkę pod kursorem jako jeniec. - Арестовывает указанный курсором юнит + Арестовывает указанный курсором юнит. Torna a unidade sob o cursor um prisioneiro Capture l'unité sous le curseur. Nastaví jednotku pod kurzorem jako zajatce. diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index f6503c2479..29a0c6b277 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -15,3 +15,17 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE((_this select 0) call FUNC(handleDeployInterrupt)); + }; + }; +}; + +class Extended_DisplayLoad_EventHandlers { + class RscDisplayMission { + ADDON = QUOTE(_this call COMPILE_SCRIPT(XEH_missionDisplayLoad)); + }; +}; diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 485a53d8f5..6f6a93e820 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -510,7 +510,7 @@ class CfgVehicles { }; GVAR(space) = 2; - GVAR(hasCargo) = 2; + GVAR(hasCargo) = 1; GVAR(size) = 3; GVAR(canLoad) = 1; @@ -524,7 +524,7 @@ class CfgVehicles { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; GVAR(space) = 3; - GVAR(hasCargo) = 3; + GVAR(hasCargo) = 1; GVAR(size) = 3; GVAR(canLoad) = 1; diff --git a/addons/cargo/XEH_PREP.hpp b/addons/cargo/XEH_PREP.hpp index 2d77fc90de..10281e2967 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -2,10 +2,15 @@ PREP(addCargoItem); PREP(addCargoVehiclesActions); PREP(canLoadItemIn); PREP(canUnloadItem); +PREP(deployCancel); +PREP(deployConfirm); PREP(getCargoSpaceLeft); PREP(getNameItem); +PREP(getSelectedItem); PREP(getSizeItem); PREP(handleDestroyed); +PREP(handleDeployInterrupt); +PREP(handleScrollWheel); PREP(initObject); PREP(initVehicle); PREP(loadItem); @@ -16,6 +21,7 @@ PREP(removeCargoItem); PREP(renameObject); PREP(setSize); PREP(setSpace); +PREP(startDeploy); PREP(startLoadIn); PREP(startUnload); PREP(unloadCarryItem); diff --git a/addons/cargo/XEH_missionDisplayLoad.sqf b/addons/cargo/XEH_missionDisplayLoad.sqf new file mode 100644 index 0000000000..7bdea7571f --- /dev/null +++ b/addons/cargo/XEH_missionDisplayLoad.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +params ["_display"]; + +_display displayAddEventHandler ["MouseZChanged", {(_this select 1) call FUNC(handleScrollWheel)}]; +_display displayAddEventHandler ["MouseButtonDown", { + // Right clicking cancels deployment + if (_this select 1 == 1) then { + ACE_player call FUNC(handleDeployInterrupt); + }; +}]; diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 1848a1e77b..f48849b50b 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -17,10 +17,10 @@ }] call CBA_fnc_addEventHandler; ["ace_unloadCargo", { - params ["_item", "_vehicle", ["_unloader", objNull]]; - TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader); + params ["_item", "_vehicle", ["_unloader", objNull], ["_place", []]]; + TRACE_4("UnloadCargo EH",_item,_vehicle,_unloader,_place); - private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); // returns true if successful + private _unloaded = [_item, _vehicle, _unloader, _place] call FUNC(unloadItem); // returns true if successful // Show hint as feedback private _hint = [LSTRING(unloadingFailed), LSTRING(unloadedItem)] select _unloaded; @@ -36,13 +36,25 @@ }; }] call CBA_fnc_addEventHandler; +// Direction must be set before setting position according to wiki +[QGVAR(setDirAndUnload), { + params ["_item", "_emptyPosAGL", "_direction"]; + + _item setDir _direction; + + [QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent; +}] call CBA_fnc_addEventHandler; + +// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly +// Do both on server to ensure they are executed in the correct order [QGVAR(serverUnload), { params ["_item", "_emptyPosAGL"]; _item hideObjectGlobal false; _item setPosASL (AGLtoASL _emptyPosAGL); - [_item, "blockDamage", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + // Let objects remain invulernable for a short while after placement + [EFUNC(common,statusEffect_set), [_item, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute; }] call CBA_fnc_addEventHandler; [QGVAR(paradropItem), { @@ -74,7 +86,7 @@ GVAR(vehicleAction) = [ GVAR(enable) && {alive _target} && {locked _target < 2} && - {(_target getVariable [QGVAR(hasCargo), getNumber (configOf _target >> QGVAR(hasCargo)) == 1])} && + {_target getVariable [QGVAR(hasCargo), getNumber (configOf _target >> QGVAR(hasCargo)) == 1]} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && {[_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew)} && {([_player, _target] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} @@ -166,3 +178,38 @@ if (isServer) then { _bodyBag setVariable [QGVAR(customName), [_target, false, true] call EFUNC(common,getName), true]; }] call CBA_fnc_addEventHandler; }; + +// Set variables, even on machines without interfaces, just to be safe +GVAR(selectedItem) = objNull; +GVAR(itemPreviewObject) = objNull; +GVAR(deployPFH) = -1; +GVAR(deployDistance) = -1; +GVAR(deployDirection) = 0; +GVAR(deployHeight) = 0; +GVAR(canDeploy) = false; + +if (!hasInterface) exitWith {}; + +// Cancel object deployment if interact menu opened +["ace_interactMenuOpened", {ACE_player call FUNC(handleDeployInterrupt)}] call CBA_fnc_addEventHandler; + +// Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting +["unit", LINKFUNC(handleDeployInterrupt)] call CBA_fnc_addPlayerEventHandler; +["vehicle", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler; +["weapon", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler; + +// When changing feature cameras, stop deployment +["featureCamera", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler; + +// Handle falling unconscious while trying to deploy +["ace_unconscious", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addEventHandler; + +// Handle surrendering and handcuffing +["ace_captiveStatusChanged", { + params ["_unit", "_state"]; + + // If surrendered or handcuffed, stop deployment + if (_state) then { + _unit call FUNC(handleDeployInterrupt); + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/cargo/functions/fnc_deployCancel.sqf b/addons/cargo/functions/fnc_deployCancel.sqf new file mode 100644 index 0000000000..50ee62c457 --- /dev/null +++ b/addons/cargo/functions/fnc_deployCancel.sqf @@ -0,0 +1,39 @@ +#include "..\script_component.hpp" +/* + * Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith + * Cancels unloading when deploying. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * player call ace_cargo_fnc_deployCancel + * + * Public: No + */ + +if (GVAR(deployPFH) == -1) exitWith {}; + +// Remove deployment pfh +GVAR(deployPFH) call CBA_fnc_removePerFrameHandler; +GVAR(deployPFH) = -1; + +params ["_unit"]; + +// Enable running again +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + +// Delete placement dummy +deleteVehicle GVAR(itemPreviewObject); + +// Remove mouse button actions +call EFUNC(interaction,hideMouseHint); + +[_unit, "DefaultAction", _unit getVariable [QGVAR(deploy), -1]] call EFUNC(common,removeActionEventHandler); +_unit setVariable [QGVAR(deploy), -1]; + +_unit setVariable [QGVAR(isDeploying), false, true]; diff --git a/addons/cargo/functions/fnc_deployConfirm.sqf b/addons/cargo/functions/fnc_deployConfirm.sqf new file mode 100644 index 0000000000..27674b0515 --- /dev/null +++ b/addons/cargo/functions/fnc_deployConfirm.sqf @@ -0,0 +1,56 @@ +#include "..\script_component.hpp" +/* + * Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith + * Confirms unloading when deploying. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * player call ace_cargo_fnc_deployConfirm + * + * Public: No + */ + +if (GVAR(deployPFH) == -1) exitWith {}; + +params ["_unit"]; + +// Delete placement dummy and unload real item from cargo at dummy position +if (!isNull GVAR(itemPreviewObject) && {[GVAR(selectedItem), GVAR(interactionVehicle), _unit, false, true] call FUNC(canUnloadItem)}) then { + // Position is AGL for unloading event + private _position = ASLToAGL getPosASL GVAR(itemPreviewObject); + private _direction = getDir GVAR(itemPreviewObject); + private _duration = GVAR(loadTimeCoefficient) * (GVAR(selectedItem) call FUNC(getSizeItem)); + + // If unload time is 0, don't show a progress bar + if (_duration <= 0) exitWith { + ["ace_unloadCargo", [GVAR(selectedItem), GVAR(interactionVehicle), _unit, [_position, _direction]]] call CBA_fnc_localEvent; + }; + + [ + _duration, + [GVAR(selectedItem), GVAR(interactionVehicle), _unit, [_position, _direction]], + { + TRACE_1("deploy finish",_this); + + ["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent; + }, + { + TRACE_1("deploy fail",_this); + }, + format [LLSTRING(unloadingItem), [GVAR(selectedItem), true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")], + { + (_this select 0) params ["_item", "_vehicle", "_unit"]; + + [_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem) // don't check for a suitable unloading position when deploying + }, + ["isNotSwimming"] + ] call EFUNC(common,progressBar); +}; + +// Cleanup EHs and preview object +_unit call FUNC(deployCancel); diff --git a/addons/cargo/functions/fnc_getSelectedItem.sqf b/addons/cargo/functions/fnc_getSelectedItem.sqf new file mode 100644 index 0000000000..a6f9141ae1 --- /dev/null +++ b/addons/cargo/functions/fnc_getSelectedItem.sqf @@ -0,0 +1,29 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal, Smith + * Get selected item from cargo menu. + * + * Arguments: + * None + * + * Return Value: + * Classname of selected item or selected object or (default: nil) + * + * Example: + * call ace_cargo_fnc_getSelectedItem + * + * Public: No + */ + +disableSerialization; + +private _display = uiNamespace getVariable QGVAR(menuDisplay); + +if (isNil "_display") exitWith {}; + +private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; + +if (_loaded isEqualTo []) exitWith {}; + +// This can be an object or a classname string +_loaded param [lbCurSel (_display displayCtrl 100), nil] diff --git a/addons/cargo/functions/fnc_handleDeployInterrupt.sqf b/addons/cargo/functions/fnc_handleDeployInterrupt.sqf new file mode 100644 index 0000000000..2cb712b5e0 --- /dev/null +++ b/addons/cargo/functions/fnc_handleDeployInterrupt.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, Smith + * Handle various interruption types. + * + * Arguments: + * 0: (New) unit + * 1: Old unit (for player change) (default: objNull) + * + * Return Value: + * None + * + * Example: + * player call ace_cargo_fnc_handleDeployInterrupt + * + * Public: No +*/ + +params ["_newPlayer", ["_oldPlayer", objNull]]; +TRACE_2("params",_newPlayer,_oldPlayer); + +if (!local _newPlayer) exitWith {}; + +if (_newPlayer getVariable [QGVAR(isDeploying), false]) then { + _newPlayer call FUNC(deployCancel); +}; + +if (_oldPlayer getVariable [QGVAR(isDeploying), false]) then { + _oldPlayer call FUNC(deployCancel); +}; diff --git a/addons/cargo/functions/fnc_handleScrollWheel.sqf b/addons/cargo/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..9ec2c498e6 --- /dev/null +++ b/addons/cargo/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,58 @@ +#include "..\script_component.hpp" +/* + * Author: L-H, commy2, Smith + * Handles rotation of object to unload. + * + * Arguments: + * 0: Scroll amount + * + * Return Value: + * If the scroll was handled + * + * Example: + * 1.2 call ace_cargo_fnc_handleScrollWheel + * + * Public: No + */ + +if (GVAR(deployPFH) == -1) exitWith {false}; + +params ["_scrollAmount"]; + +private _deployedItem = GVAR(itemPreviewObject); + +if (!CBA_events_control) then { + private _unit = ACE_player; + + // Raise/lower + // Move deployed item 15 cm per scroll interval + _scrollAmount = _scrollAmount * 0.15; + + private _position = getPosASL _deployedItem; + private _maxHeight = (_unit modelToWorldVisualWorld [0, 0, 0]) select 2; + + _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight]; + + // Move up/down object and reattach at current position + detach _deployedItem; + + // Uses this method of selecting position because setPosATL did not have immediate effect + private _positionChange = _position vectorDiff (getPosASL _deployedItem); + private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _deployedItem); + _selectionPosition = _selectionPosition vectorAdd _positionChange; + _deployedItem attachTo [_unit, _selectionPosition]; + + // Reset the deploy direction + private _direction = _deployedItem getVariable [QGVAR(deployDirection_temp), 0]; + _deployedItem setDir _direction; +} else { + // Rotate + private _direction = _deployedItem getVariable [QGVAR(deployDirection_temp), 0]; + _scrollAmount = _scrollAmount * 10; + _direction = _direction + _scrollAmount; + + _deployedItem setDir _direction; + _deployedItem setVariable [QGVAR(deployDirection_temp), _direction]; +}; + +true diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index a8522ad283..734fe99c39 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -44,7 +44,7 @@ if (_item getVariable [QGVAR(initObject),false]) exitWith {}; if (_canLoadConfig) then { GVAR(initializedItemClasses) pushBack _type; - TRACE_1("Adding load cargo action to class", _type); + TRACE_1("Adding load cargo action to class",_type); { [_type, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToClass); @@ -52,7 +52,7 @@ if (_canLoadConfig) then { } else { _item setVariable [QGVAR(initObject), true]; - TRACE_1("Adding load cargo action to object", _item); + TRACE_1("Adding load cargo action to object",_item); { [_item, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToObject); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index ed0a02cba9..af80761fe0 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -16,17 +16,23 @@ */ params ["_vehicle"]; -TRACE_1("params", _vehicle); +TRACE_1("params",_vehicle); private _type = typeOf _vehicle; private _config = configOf _vehicle; // If vehicle had space given to it via eden/public, then override config hasCargo setting -private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false]; +private _hasCargoPublic = _vehicle getVariable QGVAR(hasCargo); +private _hasCargoPublicDefined = !isNil "_hasCargoPublic"; + +if (_hasCargoPublicDefined && {!(_hasCargoPublic isEqualType false)}) then { + WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_vehicle,_type,QGVAR(hasCargo),_hasCargoPublic); +}; + private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1; // Nothing to do here if vehicle has no cargo space -if !(_hasCargoConfig || _hasCargoPublic) exitWith {}; +if !((_hasCargoPublicDefined && {_hasCargoPublic in [true, 1]}) || {!_hasCargoPublicDefined && {_hasCargoConfig}}) exitWith {}; // Check if cargo is in cargo holder types (checked when trying to search for loadable objects) private _addCargoType = GVAR(cargoHolderTypes) findIf {_type isKindOf _x} == -1; @@ -68,13 +74,13 @@ if (_type in GVAR(initializedVehicleClasses)) exitWith {}; if (_hasCargoConfig) then { GVAR(initializedVehicleClasses) pushBack _type; - TRACE_1("Adding unload cargo action to class", _type); + TRACE_1("Adding unload cargo action to class",_type); [_type, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass); } else { _vehicle setVariable [QGVAR(initVehicle), true]; - TRACE_1("Adding unload cargo action to object", _vehicle); + TRACE_1("Adding unload cargo action to object",_vehicle); [_vehicle, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToObject); }; diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index b0f7e7ffb9..f99999aabf 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -25,6 +25,9 @@ if (GVAR(interactionParadrop)) then { (_display displayCtrl 12) ctrlSetText LLSTRING(paradropButton); }; +// Disable deploy option if paradropping or in Zeus +(_display displayCtrl 13) ctrlEnable (GVAR(enableDeploy) && !GVAR(interactionParadrop) && {isNull curatorCamera}); + [{ params ["_vehicle", "_pfhID"]; @@ -33,7 +36,6 @@ if (GVAR(interactionParadrop)) then { private _display = uiNamespace getVariable QGVAR(menuDisplay); if (isNil "_display") exitWith { - GVAR(interactionVehicle) = nil; GVAR(interactionParadrop) = nil; _pfhID call CBA_fnc_removePerFrameHandler; @@ -41,18 +43,18 @@ if (GVAR(interactionParadrop)) then { // Close menu if in invalid state if ( - !alive _vehicle || + !alive ACE_player || + {!alive _vehicle} || {locked _vehicle >= 2} || {!(_vehicle getVariable [QGVAR(hasCargo), true])} || // if the cargo menu could be opened, the vehicle has QGVAR(hasCargo) in its config or the variable is set using FUNC(setSpace) { - isNull findDisplay 312 && // if in Zeus, ignore the following checks + isNull curatorCamera && // if in Zeus, ignore the checks that follow {([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE} && {(vehicle ACE_player) != _vehicle} } ) exitWith { closeDialog 0; - GVAR(interactionVehicle) = nil; GVAR(interactionParadrop) = nil; _pfhID call CBA_fnc_removePerFrameHandler; diff --git a/addons/cargo/functions/fnc_startDeploy.sqf b/addons/cargo/functions/fnc_startDeploy.sqf new file mode 100644 index 0000000000..185f71c712 --- /dev/null +++ b/addons/cargo/functions/fnc_startDeploy.sqf @@ -0,0 +1,86 @@ +#include "..\script_component.hpp" +/* + * Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith + * Starts the deploy process for unloading an object. + * + * Arguments: + * 0: Unit deploying + * + * Return Value: + * None + * + * Example: + * player call ace_cargo_fnc_startDeploy + * + * Public: No + */ + +// Deny creating preview item as it will destroy player vehicle instantly by collision +if (GVAR(interactionParadrop)) exitWith {}; + +params ["_unit"]; + +// Don't allow deploying if already deploying +if (_unit getVariable [QGVAR(isDeploying), false]) exitWith {}; + +// This can be an object or a classname string +private _item = call FUNC(getSelectedItem); + +if (isNil "_item") exitWith {}; + +// Close opened cargo menu +closeDialog 0; + +GVAR(selectedItem) = _item; + +private _classname = _item; + +if (_classname isEqualType objNull) then { + _classname = typeOf _classname; +}; + +// Prevent the placing unit from running +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// Create a local preview object +private _itemPreviewObject = createVehicleLocal [_classname, [0, 0, 0], [], 0, "CAN_COLLIDE"]; + +GVAR(itemPreviewObject) = _itemPreviewObject; + +// Prevent collisions with object +_itemPreviewObject disableCollisionWith _unit; +_itemPreviewObject enableSimulation false; +_itemPreviewObject setMass 1e-12; + +// Detect radius of zone where collision can damage the player +private _itemPreviewObjectRadius = 1 max ((boundingBoxReal [_itemPreviewObject, "FireGeometry"]) select 2); + +// Add height offset of model +private _offset = ((_itemPreviewObject modelToWorldVisual [0, 0, 0]) select 2) - ((_unit modelToWorldVisual [0, 0, 0]) select 2) + 1; + +// Attach object +_itemPreviewObject attachTo [_unit, [0, 1.5 * _itemPreviewObjectRadius, _offset]]; + +// PFH that runs while the deployment is in progress +GVAR(deployPFH) = [{ + (_this select 0) params ["_unit", "_vehicle", "_item", "_itemPreviewObject"]; + + if !( + !isNull _itemPreviewObject && + {[_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem)} // don't check for a suitable unloading position when deploying + ) exitWith { + _unit call FUNC(deployCancel); + }; +}, 0.5, [_unit, GVAR(interactionVehicle), _item, _itemPreviewObject]] call CBA_fnc_addPerFrameHandler; + +// Add mouse button action and hint +[LLSTRING(unloadObject), localize "STR_DISP_CANCEL", LLSTRING(scrollAction)] call EFUNC(interaction,showMouseHint); + +_unit setVariable [QGVAR(deploy), [ + _unit, "DefaultAction", + {GVAR(deployPFH) != -1}, + {[_this select 0] call FUNC(deployConfirm)} +] call EFUNC(common,addActionEventHandler)]; + +_unit setVariable [QGVAR(isDeploying), true, true]; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 767e5b8d68..7212d89c22 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -64,6 +64,8 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { [objNull, _item, true] call EFUNC(common,claim); + [[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); + // Fix cancelling loading a carried item if (!isNull attachedTo _item) then { detach _item; @@ -76,7 +78,7 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { [QEGVAR(common,fixFloating), _item, _item] call CBA_fnc_targetEvent; }; }, - LLSTRING(loadingItem), + format [LLSTRING(loadingItem), [_item, true] call FUNC(getNameItem), getText (configOf _vehicle >> "displayName")], { (_this select 0) call FUNC(canLoadItemIn) }, @@ -85,6 +87,9 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { true // return } else { + // Unlock the object + [objNull, _item, true] call EFUNC(common,claim); + [[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); // Fix cancelling loading a carried item diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 2fe9e923c2..39dbf59f48 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -15,18 +15,8 @@ * Public: No */ -disableSerialization; - -private _display = uiNamespace getVariable QGVAR(menuDisplay); - -if (isNil "_display") exitWith {}; - -private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; - -if (_loaded isEqualTo []) exitWith {}; - // This can be an object or a classname string -private _item = _loaded param [lbCurSel (_display displayCtrl 100), nil]; +private _item = call FUNC(getSelectedItem); if (isNil "_item") exitWith {}; @@ -58,13 +48,13 @@ if (GVAR(interactionParadrop)) exitWith { [LSTRING(unlevelFlightWarning)] call EFUNC(common,displayTextStructured); }; }, - LLSTRING(unloadingItem), + format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")], { - (_this select 0) params ["", "_target"]; + (_this select 0) params ["", "_vehicle"]; - if ((acos ((vectorUp _target) select 2)) > 30) exitWith {false}; // check flight level - if (((getPos _target) select 2) < 25) exitWith {false}; // check height - if ((speed _target) < -5) exitWith {false}; // check reverse + if ((acos ((vectorUp _vehicle) select 2)) > 30) exitWith {false}; // check flight level + if (((getPos _vehicle) select 2) < 25) exitWith {false}; // check height + if ((speed _vehicle) < -5) exitWith {false}; // check reverse true }, @@ -74,7 +64,7 @@ if (GVAR(interactionParadrop)) exitWith { }; // If in zeus -if (!isNull findDisplay 312) exitWith { +if (!isNull curatorCamera) exitWith { // Do not check distance to unit, but do check for valid position if !([_item, GVAR(interactionVehicle), objNull, true] call FUNC(canUnloadItem)) exitWith { [[LSTRING(unloadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); @@ -109,7 +99,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { { TRACE_1("unload fail",_this); }, - LLSTRING(unloadingItem), + format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")], { (_this select 0) params ["_item", "_vehicle", "_unit"]; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index c18e89361e..f32215fdd7 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -7,6 +7,9 @@ * 0: Item to be unloaded or (default: "") * 1: Holder object (vehicle) (default: objNull) * 2: Unloader (default: objNull) + * 3: Deploy parameters (default: []) + * - 0: Position AGL + * - 1: Direction * * Return Value: * Object unloaded @@ -17,8 +20,10 @@ * Public: Yes */ -params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]]]; -TRACE_3("params",_item,_vehicle,_unloader); +params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]], ["_deploy", []]]; +_deploy params ["_emptyPosAGL", "_direction"]; + +TRACE_4("params",_item,_vehicle,_unloader,_deploy); // Get config sensitive case name if (_item isEqualType "") then { @@ -41,9 +46,18 @@ if (_itemSize < 0) exitWith { false // return }; -// This covers testing vehicle stability and finding a safe position -private _emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition); -TRACE_1("findUnloadPosition",_emptyPosAGL); +private _deployed = _deploy isNotEqualTo []; + +if (!_deployed) then { + // This covers testing vehicle stability and finding a safe position + for "_i" from 1 to 3 do { + _emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition); + + if (_emptyPosAGL isNotEqualTo []) exitWith {}; + }; + + TRACE_1("findUnloadPosition",_emptyPosAGL); +}; if (_emptyPosAGL isEqualTo []) exitWith { // Display text saying there are no safe places to exit the vehicle @@ -67,9 +81,12 @@ private _object = _item; if (_object isEqualType objNull) then { detach _object; - // hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly - // Do both on server to ensure they are executed in the correct order - [QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent; + // If player unloads via deployment, set direction first, then unload + if (_deployed) then { + [QGVAR(setDirAndUnload), [_object, _emptyPosAGL, _direction], _object] call CBA_fnc_targetEvent; + } else { + [QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent; + }; if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { // Get which curators had this object as editable @@ -81,6 +98,12 @@ if (_object isEqualType objNull) then { }; } else { _object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"]; + + // If player unloads via deployment, set direction. Must happen before setPosASL command according to wiki + if (_deployed) then { + _object setDir _direction; + }; + _object setPosASL (AGLtoASL _emptyPosAGL); [QEGVAR(common,fixCollision), _object] call CBA_fnc_localEvent; @@ -88,7 +111,9 @@ if (_object isEqualType objNull) then { }; // Dragging integration -[_unloader, _object] call FUNC(unloadCarryItem); +if (!_deployed) then { + [_unloader, _object] call FUNC(unloadCarryItem); +}; // Invoke listenable event ["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent; diff --git a/addons/cargo/initSettings.inc.sqf b/addons/cargo/initSettings.inc.sqf index 2f9fd94024..029a845a25 100644 --- a/addons/cargo/initSettings.inc.sqf +++ b/addons/cargo/initSettings.inc.sqf @@ -6,7 +6,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)], _category, true, - true, + 1, {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; @@ -16,7 +16,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(loadTimeCoefficient), LSTRING(loadTimeCoefficient_description)], _category, [0, 10, 5, 1], - true, + 1, {[QGVAR(loadTimeCoefficient), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; @@ -26,7 +26,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)], _category, [0, 10, 2.5, 1], - true, + 1, {[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; @@ -36,26 +36,36 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(openAfterUnload), LSTRING(openAfterUnload_description)], _category, [[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0], - false, + 0, {[QGVAR(openAfterUnload), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; -[ - QGVAR(enableRename), - "CHECKBOX", - [LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)], - _category, - true, - false, - {[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)} -] call CBA_fnc_addSetting; - [ QGVAR(carryAfterUnload), "CHECKBOX", [LSTRING(carryAfterUnload), LSTRING(carryAfterUnload_description)], _category, true, - false, + 0, {[QGVAR(carryAfterUnload), _this] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; + +[ + QGVAR(enableDeploy), + "CHECKBOX", + [LSTRING(enableDeploy), LSTRING(enableDeploy_description)], + _category, + true, + 1, + {[QGVAR(enableDeploy), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_fnc_addSetting; + +[ + QGVAR(enableRename), + "CHECKBOX", + [LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)], + _category, + true, + 0, + {[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_fnc_addSetting; diff --git a/addons/cargo/menu.hpp b/addons/cargo/menu.hpp index 8c41fc43a5..1811369d7d 100644 --- a/addons/cargo/menu.hpp +++ b/addons/cargo/menu.hpp @@ -17,7 +17,7 @@ class GVAR(menu) { }; class CenterBackground: HeaderBackground { y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - h = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0.8)"; colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; @@ -72,7 +72,7 @@ class GVAR(menu) { idc = 11; x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; @@ -96,8 +96,15 @@ class GVAR(menu) { class btnUnload: btnCancel { text = CSTRING(unloadObject); idc = 12; - x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + x = "19.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; action = QUOTE(ACE_player call FUNC(startUnload)); }; + class btnPlace: btnUnload { + text = CSTRING(deployObject); + idc = 13; + y = "15.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + action = QUOTE(ACE_player call FUNC(startDeploy)); + colorDisabled[] = {0.25, 0.25, 0.25, 1}; + }; }; }; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 5e42af6c13..0a766ab221 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -33,6 +33,45 @@ 卸载 Boşalt + + Deploy + Piazza + Разместить + 配置する + 배치하기 + Déployer + + + Raise/Lower | (Ctrl + Scroll) Rotate + Heben/Senken | (Strg + Scrollen) Drehen + Alza/Abbassa | (Ctrl + Rotellina) Ruota + Lever/Baisser | (Ctrl + Scroll) Rotation + 上げる/下げる | (Ctrl + スクロール) 回転 + Zvednout/Snížit | (Ctrl + Kolečko myši) Otáčet + Поднять/опустить | (Ctrl + Скролл) Крутить + Wyżej/niżej | (Ctrl + Kółko myszy) obracanie + Yükselt/Alçalt | (Ctrl + Tekerlek) Döndür + Subir/Bajar | (Ctrl + Scroll) Rotar + 抬起/放低 |(Ctrl + 鼠标滚轮)旋转 + 높이기/내리기 | (컨트롤 + 스크롤) 회전 + Subir/Abaixar | (Ctrl + Scroll) Rotacionar + + + Blocked + Obstruido + Bloqueado + Заблокировано + Blokováno + Zablokowany + Bloccato + Blockiert + Bloqué + 配置不可 + 막힘 + 断开 + 斷開 + Bloke Edilmiş + Renamed to:<br/>%1 名前を次に変更:<br/>%1 @@ -48,7 +87,7 @@ Custom name has been cleared. - カスタムネームが削除されました。 + カスタム名が削除されました。 Le nom personnalisé a été supprimé. Пользовательское название удалено. Eigener Name wurde gelöscht. @@ -108,7 +147,7 @@ Carga Carico Cargaison - カーゴ + 貨物 화물 貨物 货物 @@ -124,7 +163,7 @@ Menu de carga Menù del Carico Menu de cargaison - カーゴ メニュー + 貨物メニュー 화물 메뉴 貨物選單 货物菜单 @@ -140,7 +179,7 @@ Espacio de carga restante: %1 Spazio di carico rimanente: %1 Espace de chargement restant : %1 - カーゴの空き容量: %1 + 貨物室の空き容量: %1 선적 공간 남음: %1 貨物剩餘空間: %1 货物剩余空间:%1 @@ -156,7 +195,7 @@ Habilitar carga Abilita Carico Activer la cargaison - カーゴを有効化 + 貨物を有効化 화물 활성화 啟用貨物裝載 启用货物装载 @@ -172,7 +211,7 @@ Umožňuje naložit předměty do nákladového prostoru vozidla Abilita il modulo di caricamento nel carico Active la possibilité de charger du matériel dans un module de fret (véhicule/container). - カーゴ モジュールで積み込みを有効化 + 貨物積載モジュールを有効化 화물 모듈을 활성화합니다 啟用貨物裝載功能 启用货物装载功能 @@ -187,7 +226,7 @@ Ajustes de carga Impostazioni Carico Paramètres de cargaison - カーゴ設定 + 貨物設定 화물 설정 貨物設定 货物设定 @@ -203,7 +242,7 @@ Konfigurace nákladního modulu Configura le impostazioni del modulo carico Configure les paramètres du module de cargaison. - カーゴ モジュールの設定を構成 + 貨物モジュールの設定を変更します 화물 모듈의 환경 설정을 바꿉니다 配置貨物模塊設定 配置货物模块设定 @@ -219,7 +258,7 @@ %1<br/>caricato su<br/>%2 %1<br/>berakodva ide:<br/>%2 %1<br/>загружен в<br/>%2 - %1 は<br/>%2 へ<br/>積み込まれました + %1 を<br/>%2 に<br/>積み込みました %1은(는)<br/>%2 에 실림 %1<br/>裝載至<br/>%2 %1<br/>装载至<br/>%2 @@ -235,42 +274,28 @@ Hai scaricato<br/>%1 da<br/>%2 1%<br/>kirakodva ebből:<br/>%2 %1<br/>разгружен из<br/>%2 - %1 が<br/>%2 から<br/>降ろされました + %1 を<br/>%2 から<br/>降ろしました %1은(는)<br/>%2에서 내려짐 從<br/>%2卸載<br/>%1 从<br/>%2卸载<br/>%1 - Loading Cargo - Belade - Carregando carga - Ładowanie cargo - Nakládám - Погрузка - Caricando - Cargando - Chargement de la cargaison - カーゴへ積み込んでいます - 화물 싣기 - 裝載貨物中 - 正在装载货物 - Kargo Yükleniyor + Loading %1 into %2... + Cargando %1 en %2... + Caricando %1 in %2... + %1 を %2 に積み込んでいます・・・ + Загружаем %1 в %2... + %1을(를) %2에 싣는 중... + Chargement %1 dans %2... - Unloading Cargo - Entlade - Descarregando carga - Rozładowywanie cargo - Vykládám - Выгрузка - Scaricando - Descargando - Déchargement de la cargaison - カーゴから降ろしています - 화물 내리기 - 卸載貨物中 - 正在卸载货物 - Kargo Boşaltılıyor + Unloading %1 from %2... + Descargando %1 de %2... + Scaricando %1 da %2... + %1 を %2 から降ろしています・・・ + Выгружаем %1 из %2... + %1을(를) %2(으)로부터 내리는 중... + Déchargement %1 de %2... %1<br/>could not be loaded @@ -309,20 +334,22 @@ Kann nicht entladen werden Impossibile da scaricare Ne peut pas être déchargé - 降ろせません + 荷降ろし不可能です 하역할 수가 없습니다 + Не может быть выгружен Cargo Size: %1 Frachtgröße: %1 Dimensione Carico: %1 Encombrement fret: %1 - カーゴ サイズ: %1 + 貨物のサイズ: %1 화물 크기: %1 + Размер груза: %1 Custom Name - カスタムネーム + カスタム名 Nom personnalisé Eigener Name Nome Personalizzato @@ -335,7 +362,7 @@ Set a custom cargo name used in the cargo interface. - カーゴ一覧で使用されるカスタムネームを設定します。 + 貨物インターフェイスで使用されるカスタム名を設定します。 Définit un nom de fret personnalisé qui sera visible dans le menu de cargaison. Установить пользовательское имя груза, используемое в интерфейсе погрузки. Definiere eigenen Frachtnamen, welcher im Frachtraum genutzt wird. @@ -350,7 +377,7 @@ Cargo Space Frachtraum Spazio di Carico - カーゴ スペース + 貨物室の容量 貨物空間 货物空间 Przestrzeń ładunkowa @@ -366,7 +393,7 @@ The cargo space available in this vehicle/container Verfügbarer Frachtraum in diesem Fahrzeug/Container Lo spazio disponibile in questo veicolo/container - この車両/コンテナでカーゴ スペースを使えるようにします + この車両/コンテナで使用可能な貨物室の容量 設定此載具/集裝箱可裝載多少貨物 设定此载具/集装箱可装载多少货物 Dostępna przestrzeń ładunkowa w tym pojeździe/kontenerze @@ -381,7 +408,7 @@ Cargo Size Frachtgröße Dimensioni nel Carico - カーゴ サイズ + 貨物のサイズ 貨物的大小 货物的大小 Wielkość ładunku @@ -397,7 +424,7 @@ The cargo space required to hold this object (-1 for not loadable) Frachtraumgröße, welche zum Einladen dieses Objektes benötigt wird (-1 nicht einladbar) Lo spazio di carico necessario per contenere questo oggetto (-1 per non caricabile) - オブジェクトを積載するのに必要なカーゴ スペース (-1 で積載不可にします) + このオブジェクトの積載に必要な貨物室の容量 (-1 で積載不可に) 此貨物會佔掉多少空間(設定-1的話此貨物就不能被裝載) 此货物会占掉多少空间(设定 -1 的话此货物就不能被装载) Wymagana przestrzeń ładunkowa dla tego obiektu (-1 dla niemożliwych do załadowania) @@ -456,7 +483,7 @@ Modifier for how long it takes to paradrop a cargo item. Beeinflusst die zusätzliche Zeit für Türlastabwürfe. - カーゴ アイテムを空中投下するまでの時間を変更します。 + 貨物の空中投下に掛かる時間を変更します。 Modifica quanto tempo viene impiegato per paracadutare oggetti dal carico. Modifie le temps nécessaire au paralargage d'une cargaison. 設定空投所需消耗的時間 @@ -471,7 +498,7 @@ Load Time Coefficient Ladezeitmultiplikator - 積載所要時間係数 + 積載の所要時間係数 Współczynnik czasu załadowania Coefficente Tempo Caricamento Коэф. времени погрузки @@ -486,10 +513,10 @@ Modifies how long it takes to load/unload items.\nTime, in seconds, is the size of the item multiplied by this value. Gibt an, wie lange das Laden / Entladen von Gegenständen dauern soll.\nZeit in Sekunden, die mit der Größe des Gegenstandes multipliziert wird. - アイテムのロード/アンロードに掛かる時間を変更します。\n時間 (秒) は、アイテムのサイズにこの値を掛けたものです。 + 貨物の積み込み/積み下ろしに掛かる時間を変更します。\n時間 (秒単位) は、貨物のサイズにこの値を掛けたものです。 Modyfikuje, jak długo zajmuje załadowywanie/wyładowywanie przedmiotów. \nCzasem, w sekundach, jest wielkość przedmiotu razy jego wartość. Modifica il tempo impiegato per caricare o scaricare gli oggetti.\nIl tempo, in secondi, equivale alla dimensione dell'oggetto moltiplicata per questo valore - Изменяет время для загрузки/выгрузки предметов. \n Время (сек) - это размер предмета, умноженный на это значение. + Изменяет время для загрузки/выгрузки предметов. \nВремя (сек) - это размер предмета, умноженный на это значение. Coeficiente de quanto tempo leva para carregar/descarregar itens.\nTempo, em segundos, é o tamanho do objeto multiplicado por esse valor. Modifie le temps nécessaire pour charger/décharger des objets.\nLe temps, en secondes, est calculé en multipliant la taille de l'élément par ce coefficient. 修改要花多長時間來裝載/卸載物品。\n時間,以秒為單位,而物品的大小數值與這個係數成比。 @@ -501,7 +528,7 @@ Reopen Cargo Menu Kargo Menüsünü Tekrar Aç - カーゴ メニューを再度開く + 貨物メニューを再度開く Rouvrir le menu de cargaison Переоткрыть меню погрузки Frachtmenü erneut öffnen @@ -515,7 +542,7 @@ Reopen the Cargo Menu after successful unload. Başarılı bir yük indirmeden sonra Kargo Menüsünü tekrar göster. - カーゴを降ろした後に再びカーゴ メニューを開きます。 + 貨物を降ろした後に再び貨物メニューを開きます。 Réouvre le menu de cargaison après un déchargement réussi. Переоткрыть меню погрузки после успешной выгрузки. Frachtmenü erneut öffnen, nach erfolgreichen Entladen. @@ -531,7 +558,7 @@ 화물 내린 후 운반 Нести после выгрузки Llevar encima tras la descarga - 荷降ろし後の運搬 + 荷降ろし後に持ち運ぶ Niesienie Po Rozładowaniu Nach dem Entladen tragen Trasporta dopo aver Scaricato @@ -543,12 +570,28 @@ 화물 아이템을 내린 후 들거나 끌지 여부를 결정합니다. Нужно ли переносить или тащить предметы после их выгрузки. Controla si los objetos de carga son llevados encima o arrastrados despues de la descarga. - 荷降ろし後、貨物アイテムを運ぶか引きずるかを制御する。 + 荷降ろし後、貨物を運ぶか引きずるかを制御する。 Kontroluje, czy przedmioty z ładunku są przenoszone lub ciągnięte po ich wyładowaniu. Steuert, ob Objekte nach dem Entladen getragen oder gezogen werden. Determina se un oggetto verrà subito trasportato o trascinato dopo essere stato scaricato. Active si les éléments de cargaison sont portés ou traînés après le déchargement. Controla se os itens de carga são carregados ou arrastados após a descarga. + + Enable deploy + Abilita Piazzamento + Включить размещение + 配置機能を有効化 + 배치 활성화 + Permettre le placement + + + Controls whether cargo items can be unloaded via the deploy method. + Determina se oggetti in carico possono essere scaricati e piazzati direttamente. + Определяет, можно ли выгружать грузы с помощью метода размещения. + 配置機能を介して貨物アイテムを降ろすことが出来るかどうかを制御します。 + 배치 방법을 통해 화물 아이템을 내릴 수 있는지 여부를 제어합니다. + Contrôler si les éléments de cargaison peuvent être déchargés via la méthode de déploiement. + diff --git a/addons/casings/CfgVehicles.hpp b/addons/casings/CfgVehicles.hpp new file mode 100644 index 0000000000..73d06bc0ac --- /dev/null +++ b/addons/casings/CfgVehicles.hpp @@ -0,0 +1,6 @@ +class CfgVehicles { + class FxCartridge; + class FxCartridge_65_caseless: FxCartridge { + GVAR(model) = ""; // note: the vanilla 6.5 caseless don't actually use this, just being safe + }; +}; diff --git a/addons/casings/XEH_postInit.sqf b/addons/casings/XEH_postInit.sqf index e91ab96c0d..c1baad68e9 100644 --- a/addons/casings/XEH_postInit.sqf +++ b/addons/casings/XEH_postInit.sqf @@ -4,4 +4,4 @@ if (!hasInterface || !GVAR(enabled)) exitWith {}; GVAR(cachedCasings) = createHashMap; GVAR(casings) = []; -["CAManBase", "FiredMan", {call FUNC(createCasing)}] call CBA_fnc_addClassEventHandler; +["CAManBase", "FiredMan", LINKFUNC(createCasing)] call CBA_fnc_addClassEventHandler; diff --git a/addons/casings/config.cpp b/addons/casings/config.cpp index 815048a082..29d0b7cb89 100644 --- a/addons/casings/config.cpp +++ b/addons/casings/config.cpp @@ -15,3 +15,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index 99dbe38c76..88e08e5adb 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -20,31 +20,30 @@ params ["_unit", "", "", "", "_ammo"]; if (!isNull objectParent _unit) exitWith {}; -private _modelPath = GVAR(cachedCasings) get _ammo; -if (isNil "_modelPath") then { +private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { private _cartridge = getText (configFile >> "CfgAmmo" >> _ammo >> "cartridge"); - //Default cartridge is a 5.56mm model - _modelPath = switch (_cartridge) do { - case "FxCartridge_9mm": { "A3\Weapons_f\ammo\cartridge_small.p3d" }; - case "FxCartridge_65": { "A3\weapons_f\ammo\cartridge_65.p3d" }; - case "FxCartridge_762": { "A3\weapons_f\ammo\cartridge_762.p3d" }; - case "FxCartridge_762x39": { "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d" }; - case "FxCartridge_93x64_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d" }; - case "FxCartridge_338_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d" }; - case "FxCartridge_338_NM": { "A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" }; - case "FxCartridge_127": { "A3\weapons_f\ammo\cartridge_127.p3d" }; - case "FxCartridge_127x54": { "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" }; - case "FxCartridge_slug": { "A3\weapons_f\ammo\cartridge_slug.p3d" }; - case "FxCartridge_12Gauge_HE_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_he_lxws.p3d" }; - case "FxCartridge_12Gauge_Slug_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d" }; - case "FxCartridge_12Gauge_Smoke_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d" }; - case "FxCartridge_12Gauge_Pellet_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d" }; - case "": { "" }; - default { "A3\Weapons_f\ammo\cartridge.p3d" }; + if (_cartridge == "") then { // return (note: can't use exitWith) + "" + } else { + private _cartridgeConfig = configFile >> "CfgVehicles" >> _cartridge; + + // if explicitly defined, use ACE's config + if (isText (_cartridgeConfig >> QGVAR(model))) exitWith { + getText (_cartridgeConfig >> QGVAR(model)) + }; + // use casing's default model + private _model = getText (_cartridgeConfig >> "model"); + if ("a3\weapons_f\empty" in toLowerANSI _model) exitWith { "" }; + + // Add file extension if missing (fileExists needs file extension) + if ((_model select [count _model - 4]) != ".p3d") then { + _model = _model + ".p3d"; + }; + + ["", _model] select (fileExists _model) }; - GVAR(cachedCasings) set [_ammo, _modelPath]; -}; +}, true]; if (_modelPath isEqualTo "") exitWith {}; diff --git a/addons/chemlights/XEH_postInit.sqf b/addons/chemlights/XEH_postInit.sqf index 6b22de4a3c..b40ffb764e 100644 --- a/addons/chemlights/XEH_postInit.sqf +++ b/addons/chemlights/XEH_postInit.sqf @@ -2,6 +2,6 @@ if (!hasInterface) exitWith {}; -["ace_firedPlayer", DFUNC(throwEH)] call CBA_fnc_addEventHandler; -// ["ace_firedPlayerNonLocal", DFUNC(throwEH)] call CBA_fnc_addEventHandler; -// ["ace_firedNonPlayer", DFUNC(throwEH)] call CBA_fnc_addEventHandler; +["ace_firedPlayer", LINKFUNC(throwEH)] call CBA_fnc_addEventHandler; +// ["ace_firedPlayerNonLocal", LINKFUNC(throwEH)] call CBA_fnc_addEventHandler; +// ["ace_firedNonPlayer", LINKFUNC(throwEH)] call CBA_fnc_addEventHandler; diff --git a/addons/common/CfgMoves.hpp b/addons/common/CfgMoves.hpp index 14686526e9..da83153b15 100644 --- a/addons/common/CfgMoves.hpp +++ b/addons/common/CfgMoves.hpp @@ -1,5 +1,6 @@ class CfgMovesBasic { class Default; + // From ACRE class ManActions { GVAR(stop) = QGVAR(stop); @@ -82,5 +83,14 @@ class CfgMovesMaleSdr: CfgMovesBasic { class AinvPknlMstpSnonWnonDnon_medic0: HealBase { variantsPlayer[] = {}; }; + + // Idle affects legs when weapon switching - fixes units sliding when holstering weapons + class AmovPercMstpSnonWnonDnon: StandBase { + idle = ""; + }; + // Need to reset idle, as it breaks animations otherwise + class CutSceneAnimationBase: AmovPercMstpSnonWnonDnon { + idle = "idleDefault"; + }; }; }; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index ce6ac334ee..fb64d464df 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -13,6 +13,7 @@ PREP(addLineToDebugDraw); PREP(addSwayFactor); PREP(addToInventory); PREP(addWeapon); +PREP(adjustMagazineAmmo); PREP(assignedItemFix); PREP(assignObjectsInList); PREP(ambientBrightness); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 414a0ff7b5..f97009808f 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -18,7 +18,7 @@ ////////////////////////////////////////////////// //Status Effect EHs: -[QGVAR(setStatusEffect), {_this call FUNC(statusEffect_set)}] call CBA_fnc_addEventHandler; +[QGVAR(setStatusEffect), LINKFUNC(statusEffect_set)] call CBA_fnc_addEventHandler; ["forceWalk", false, ["ace_advanced_fatigue", "ACE_SwitchUnits", "ACE_Attach", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_Trenches", "ace_medical_fracture"]] call FUNC(statusEffect_addType); ["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", "ace_medical_fracture"]] call FUNC(statusEffect_addType); ["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered)]] call FUNC(statusEffect_addType); @@ -29,7 +29,7 @@ ["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); ["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType); ["disableWeaponAssembly", false, ["ace_common", "ace_common_lockVehicle", "ace_csw"]] call FUNC(statusEffect_addType); -["lockInventory", true, []] call FUNC(statusEffect_addType); +["lockInventory", true, [], true] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { params ["_object", "_set"]; @@ -96,7 +96,7 @@ _object setVariable ["acre_sys_core_isDisabled", _set > 0, true]; }; if (["task_force_radio"] call FUNC(isModLoaded)) then { - _object setVariable ["tf_voiceVolume", [1, 0] select (_set > 0), true]; + _object setVariable ["tf_voiceVolume", parseNumber (_set == 0), true]; }; }] call CBA_fnc_addEventHandler; @@ -142,11 +142,10 @@ if (isServer) then { if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then { { if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith { - INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x); + INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x); _x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true]; }; - nil - } count (curatorEditableObjects _zeusLogic); + } forEach (curatorEditableObjects _zeusLogic); }; }]; }; @@ -157,9 +156,9 @@ if (isServer) then { INFO_2("Headbug Used: Name: %1, Animation: %2",_profileName,_animation); }] call CBA_fnc_addEventHandler; -[QGVAR(fixCollision), FUNC(fixCollision)] call CBA_fnc_addEventHandler; -[QGVAR(fixFloating), FUNC(fixFloating)] call CBA_fnc_addEventHandler; -[QGVAR(fixPosition), FUNC(fixPosition)] call CBA_fnc_addEventHandler; +[QGVAR(fixCollision), LINKFUNC(fixCollision)] call CBA_fnc_addEventHandler; +[QGVAR(fixFloating), LINKFUNC(fixFloating)] call CBA_fnc_addEventHandler; +[QGVAR(fixPosition), LINKFUNC(fixPosition)] call CBA_fnc_addEventHandler; ["ace_loadPersonEvent", LINKFUNC(loadPersonLocal)] call CBA_fnc_addEventHandler; ["ace_unloadPersonEvent", LINKFUNC(unloadPersonLocal)] call CBA_fnc_addEventHandler; @@ -209,8 +208,8 @@ if (isServer) then { }] call CBA_fnc_addEventHandler; // Request framework -[QGVAR(requestCallback), FUNC(requestCallback)] call CBA_fnc_addEventHandler; -[QGVAR(receiveRequest), FUNC(receiveRequest)] call CBA_fnc_addEventHandler; +[QGVAR(requestCallback), LINKFUNC(requestCallback)] call CBA_fnc_addEventHandler; +[QGVAR(receiveRequest), LINKFUNC(receiveRequest)] call CBA_fnc_addEventHandler; [QGVAR(systemChatGlobal), {systemChat _this}] call CBA_fnc_addEventHandler; @@ -219,7 +218,7 @@ if (isServer) then { [QGVAR(enableSimulationGlobal), {(_this select 0) enableSimulationGlobal (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(setShotParents), {(_this select 0) setShotParents [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; ["ace_setOwner", {(_this select 0) setOwner (_this select 1)}] call CBA_fnc_addEventHandler; - [QGVAR(serverLog), FUNC(serverLog)] call CBA_fnc_addEventHandler; + [QGVAR(serverLog), LINKFUNC(serverLog)] call CBA_fnc_addEventHandler; [QGVAR(claimSafe), LINKFUNC(claimSafeServer)] call CBA_fnc_addEventHandler; }; @@ -236,14 +235,14 @@ if (!isServer) then { ["ACEa", [player]] call CBA_fnc_serverEvent; }] call CBA_fnc_addEventHandler; } else { - ["ACEa", FUNC(_handleRequestAllSyncedEvents)] call CBA_fnc_addEventHandler; + ["ACEa", LINKFUNC(_handleRequestAllSyncedEvents)] call CBA_fnc_addEventHandler; }; -["ACEe", FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler; -["ACEs", FUNC(_handleRequestSyncedEvent)] call CBA_fnc_addEventHandler; +["ACEe", LINKFUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler; +["ACEs", LINKFUNC(_handleRequestSyncedEvent)] call CBA_fnc_addEventHandler; if (isServer) then { - [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; }; @@ -361,7 +360,7 @@ addMissionEventHandler ["PlayerViewChanged", { private _position = [player] call FUNC(getUavControlPosition); private _seatAI = objNull; private _turret = []; - switch (toLower _position) do { + switch (toLowerANSI _position) do { case (""): { _UAV = objNull; // set to objNull if not actively controlling }; @@ -392,8 +391,8 @@ addMissionEventHandler ["PlayerViewChanged", { // Eventhandlers for player controlled machines ////////////////////////////////////////////////// -[QGVAR(displayTextStructured), {_this call FUNC(displayTextStructured)}] call CBA_fnc_addEventHandler; -[QGVAR(displayTextPicture), {_this call FUNC(displayTextPicture)}] call CBA_fnc_addEventHandler; +[QGVAR(displayTextStructured), LINKFUNC(displayTextStructured)] call CBA_fnc_addEventHandler; +[QGVAR(displayTextPicture), LINKFUNC(displayTextPicture)] call CBA_fnc_addEventHandler; ["ace_unconscious", { params ["_unit", "_isUnconscious"]; @@ -403,7 +402,7 @@ addMissionEventHandler ["PlayerViewChanged", { }; }] call CBA_fnc_addEventHandler; -["ace_useItem", DFUNC(useItem)] call CBA_fnc_addEventHandler; +["ace_useItem", LINKFUNC(useItem)] call CBA_fnc_addEventHandler; ////////////////////////////////////////////////// @@ -499,10 +498,24 @@ GVAR(reloadMutex_lastMagazines) = []; // Start the sway loop ////////////////////////////////////////////////// ["CBA_settingsInitialized", { + ["multiplier", { + switch (true) do { + case (isWeaponRested ACE_player): { + GVAR(swayFactor) * GVAR(restedSwayFactor) + }; + case (isWeaponDeployed ACE_player): { + GVAR(swayFactor) * GVAR(deployedSwayFactor) + }; + default { + GVAR(swayFactor) + }; + }; + }, QUOTE(ADDON)] call FUNC(addSwayFactor); + [{ // frame after settingsInitialized to ensure all other addons have added their factors - if ((GVAR(swayFactorsBaseline) + GVAR(swayFactorsMultiplier)) isNotEqualTo []) then { - call FUNC(swayLoop) + if (GVAR(enableSway)) then { + call FUNC(swayLoop); }; // check for pre-3.16 sway factors being added if (!isNil {missionNamespace getVariable "ACE_setCustomAimCoef"}) then { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 78c08d5e42..9b5d27d12c 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -32,6 +32,7 @@ ACE_COUNTERS = []; GVAR(statusEffect_Names) = []; GVAR(statusEffect_isGlobal) = []; +GVAR(statusEffect_sendJIP) = []; GVAR(setHearingCapabilityMap) = []; diff --git a/addons/common/XEH_preStart.sqf b/addons/common/XEH_preStart.sqf index b872756af8..208adea7b1 100644 --- a/addons/common/XEH_preStart.sqf +++ b/addons/common/XEH_preStart.sqf @@ -5,7 +5,7 @@ if (isFilePatchingEnabled) then { private _notLoaded = configProperties [configfile >> "ace_notLoaded", "isText _x"]; { - INFO_2("%1 not loaded because %2",configName _x, getText _x); + INFO_2("%1 not loaded because %2",configName _x,getText _x); } forEach _notLoaded; }; diff --git a/addons/common/define.hpp b/addons/common/define.hpp index 9e9e92ecb5..ce8765ec9f 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -1,124 +1,106 @@ - #ifndef ACE_DEFINE_H #define ACE_DEFINE_H // define.hpp -#define true 1 -#define false 0 +#define true 1 +#define false 0 -#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_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_XKEYDESC 40 -#define CT_XBUTTON 41 -#define CT_XLISTBOX 42 -#define CT_XSLIDER 43 -#define CT_XCOMBO 44 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_SHORTCUTBUTTON 16 +#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 80 +#define CT_OBJECT_ZOOM 81 #define CT_OBJECT_CONTAINER 82 #define CT_OBJECT_CONT_ANIM 83 -#define CT_LINEBREAK 98 -#define CT_ANIMATED_USER 99 -#define CT_MAP 100 -#define CT_MAP_MAIN 101 -#define CT_LISTNBOX 102 +#define CT_LINEBREAK 98 +#define CT_ANIMATED_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define CT_LISTNBOX 102 // 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_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_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 // this style works for CT_STATIC in conjunction with ST_MULTI -#define ST_KEEP_ASPECT_RATIO 0x800 +#define ST_SHADOW 0x100 +#define ST_NO_RECT 0x200 // this style works for CT_STATIC in conjunction with ST_MULTI +#define ST_KEEP_ASPECT_RATIO 0x800 -#define ST_TITLE ST_TITLE_BAR + ST_CENTER +#define ST_TITLE ST_TITLE_BAR + ST_CENTER // Slider styles -#define SL_DIR 0x400 -#define SL_VERT 0 -#define SL_HORZ 0x400 +#define SL_DIR 0x400 +#define SL_VERT 0 +#define SL_HORZ 0x400 -#define SL_TEXTURES 0x10 +#define SL_TEXTURES 0x10 // Listbox styles -#define LB_TEXTURES 0x10 -#define LB_MULTI 0x20 -#define FONT_ACE "RobotoCondensed" +#define LB_TEXTURES 0x10 +#define LB_MULTI 0x20 +#define FONT_ACE "RobotoCondensed" class ACE_gui_backgroundBase { - type = CT_STATIC; - idc = -1; - style = ST_PICTURE; - colorBackground[] = {0,0,0,0}; - colorText[] = {1, 1, 1, 1}; - font = FONT_ACE; - text = ""; - sizeEx = 0.032; + type = CT_STATIC; + idc = -1; + style = ST_PICTURE; + colorBackground[] = {0, 0, 0, 0}; + colorText[] = {1, 1, 1, 1}; + font = FONT_ACE; + text = ""; + sizeEx = 0.032; }; + class ACE_gui_editBase { type = 2; x = 0; y = 0; h = 0.04; w = 0.2; - colorBackground[] = - { - 0, - 0, - 0, - 1 - }; - colorText[] = - { - 0.95, - 0.95, - 0.95, - 1 - }; - colorSelection[] = - { - "(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", - "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", - "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", - 1 - }; + colorBackground[] = {0, 0, 0, 1}; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorSelection[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", 1}; autocomplete = ""; text = ""; size = 0.2; @@ -126,629 +108,621 @@ class ACE_gui_editBase { font = "RobotoCondensed"; shadow = 2; sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorDisabled[] = - { - 1, - 1, - 1, - 0.25 + colorDisabled[] = {1, 1, 1, 0.25}; +}; + +class ACE_gui_buttonBase { + idc = -1; + type = 16; + style = ST_LEFT; + text = ""; + action = ""; + x = 0; + y = 0; + w = 0.25; + h = 0.04; + size = 0.03921; + sizeEx = 0.03921; + color[] = {1, 1, 1, 1}; + color2[] = {1, 1, 1, 1}; + colorBackground[] = {1, 1, 1, 0.95}; + colorbackground2[] = {1, 1, 1, 0.95}; + colorDisabled[] = {1, 1, 1, 0.6}; + colorFocused[] = {1, 1, 1, 1}; + colorBackgroundFocused[] = {1, 1, 1, 1}; + periodFocus = 1.2; + periodOver = 0.8; + default = 0; + + class HitZone { + left = 0; + top = 0; + right = 0; + bottom = 0; + }; + class ShortcutPos { + left = 0; + top = 0; + w = 0; + h = 0; + }; + class TextPos { + left = 0.002; + top = 0.0004; + right = 0; + bottom = 0; + }; + + textureNoShortcut = ""; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + period = 0.5; + font = FONT_ACE; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick", 0.09, 1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush", 0, 0}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter", 0.07, 1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape", 0.09, 1}; + + class Attributes { + font = FONT_ACE; + color = "#E5E5E5"; + align = "center"; + shadow = "true"; + }; + class AttributesImage { + font = FONT_ACE; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; }; }; - - -class ACE_gui_buttonBase { - idc = -1; - type = 16; - style = ST_LEFT; - text = ""; - action = ""; - x = 0.0; - y = 0.0; - w = 0.25; - h = 0.04; - size = 0.03921; - sizeEx = 0.03921; - color[] = {1.0, 1.0, 1.0, 1}; - color2[] = {1.0, 1.0, 1.0, 1}; - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {1,1,1,1}; - colorBackgroundFocused[] = {1,1,1,1}; - periodFocus = 1.2; - periodOver = 0.8; - default = 0; - class HitZone { - left = 0.00; - top = 0.00; - right = 0.00; - bottom = 0.00; - }; - - class ShortcutPos { - left = 0.00; - top = 0.00; - w = 0.00; - h = 0.00; - }; - - class TextPos { - left = 0.002; - top = 0.0004; - right = 0.0; - bottom = 0.00; - }; - textureNoShortcut = ""; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - period = 0.5; - font = FONT_ACE; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.0,0}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.07,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; - class Attributes { - font = FONT_ACE; - color = "#E5E5E5"; - align = "center"; - shadow = "true"; - }; - class AttributesImage { - font = FONT_ACE; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; -}; - class ACE_gui_RscProgress { - type = 8; - style = 0; - colorFrame[] = {1,1,1,0.7}; - colorBar[] = {1,1,1,0.7}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 8; + style = 0; + colorFrame[] = {1, 1, 1, 0.7}; + colorBar[] = {1, 1, 1, 0.7}; + texture = "#(argb,8,8,3)color(1,1,1,0.7)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; - class ACE_gui_staticBase { - idc = -1; - type = CT_STATIC; - x = 0.0; - y = 0.0; - w = 0.183825; - h = 0.104575; - style = ST_LEFT; - font = FONT_ACE; - sizeEx = 0.03921; - colorText[] = {0.95, 0.95, 0.95, 1.0}; - colorBackground[] = {0, 0, 0, 0}; - text = ""; + idc = -1; + type = CT_STATIC; + x = 0; + y = 0; + w = 0.183825; + h = 0.104575; + style = ST_LEFT; + font = FONT_ACE; + sizeEx = 0.03921; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorBackground[] = {0, 0, 0, 0}; + text = ""; }; class RscListBox; class ACE_gui_listBoxBase: RscListBox { - type = CT_LISTBOX; - style = ST_MULTI; - font = FONT_ACE; - sizeEx = 0.03921; - color[] = {1, 1, 1, 1}; - colorText[] = {0.543, 0.5742, 0.4102, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 1}; - colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; - colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - period = 1.2; - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 1}; - maxHistoryDelay = 1.0; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - soundSelect[] = {"",0.1,1}; - soundExpand[] = {"",0.1,1}; - soundCollapse[] = {"",0.1,1}; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; + type = CT_LISTBOX; + style = ST_MULTI; + font = FONT_ACE; + sizeEx = 0.03921; + color[] = {1, 1, 1, 1}; + colorText[] = {0.543, 0.5742, 0.4102, 1}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 1}; + colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1}; + colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; + period = 1.2; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 1}; + maxHistoryDelay = 1; autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; - class ScrollBar { - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = ""; - arrowFull = ""; - arrowEmpty = ""; - border = ""; - }; -}; + autoScrollDelay = 5; + autoScrollRewind = 0; + soundSelect[] = {"", 0.1, 1}; + soundExpand[] = {"", 0.1, 1}; + soundCollapse[] = {"", 0.1, 1}; + class ListScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; + class ScrollBar { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = ""; + arrowFull = ""; + arrowEmpty = ""; + border = ""; + }; +}; class ACE_gui_listNBox { - type = CT_LISTNBOX;// 102; - style =ST_MULTI; - w = 0.4; - h = 0.4; - font = FONT_ACE; - sizeEx = 0.031; + type = CT_LISTNBOX; // 102; + style = ST_MULTI; + w = 0.4; + h = 0.4; + font = FONT_ACE; + sizeEx = 0.031; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - columns[] = {0.0}; - color[] = {1, 1, 1, 1}; - - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 0.2}; - colorText[] = {1,1, 1, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 0.0}; - colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; - colorActive[] = {0,0,0,1}; - colorDisabled[] = {0,0,0,0.3}; - rows = 1; - - drawSideArrows = 0; - idcLeft = -1; - idcRight = -1; - maxHistoryDelay = 1; - soundSelect[] = {"", 0.1, 1}; - period = 1; - shadow = 2; - class ScrollBar { - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - border = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - thumb = "#(argb,8,8,3)color(1,1,1,1)"; - }; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; + autoScrollDelay = 5; + autoScrollRewind = 0; + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + columns[] = {0}; + color[] = {1, 1, 1, 1}; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1, 1, 1, 1}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0}; + colorSelectBackground2[] = {0, 0, 0, 0.5}; + colorActive[] = {0, 0, 0, 1}; + colorDisabled[] = {0, 0, 0, 0.3}; + rows = 1; + + drawSideArrows = 0; + idcLeft = -1; + idcRight = -1; + maxHistoryDelay = 1; + soundSelect[] = {"", 0.1, 1}; + period = 1; + shadow = 2; + + class ScrollBar { + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + border = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "#(argb,8,8,3)color(1,1,1,1)"; + }; + class ListScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; +}; class RscCombo; class ACE_gui_comboBoxBase: RscCombo { - idc = -1; - type = 4; - style = "0x10 + 0x200"; - x = 0; - y = 0; - w = 0.3; - h = 0.035; - color[] = {0,0,0,0.6}; - colorActive[] = {1,0,0,1}; - colorBackground[] = {0,0,0,1}; - colorDisabled[] = {1,1,1,0.25}; - colorScrollbar[] = {1,0,0,1}; - colorSelect[] = {0,0,0,1}; - colorSelectBackground[] = {1,1,1,0.7}; - colorText[] = {1,1,1,1}; + idc = -1; + type = 4; + style = "0x10 + 0x200"; + x = 0; + y = 0; + w = 0.3; + h = 0.035; + color[] = {0, 0, 0, 0.6}; + colorActive[] = {1, 0, 0, 1}; + colorBackground[] = {0, 0, 0, 1}; + colorDisabled[] = {1, 1, 1, 0.25}; + colorScrollbar[] = {1, 0, 0, 1}; + colorSelect[] = {0, 0, 0, 1}; + colorSelectBackground[] = {1, 1, 1, 0.7}; + colorText[] = {1, 1, 1, 1}; - arrowEmpty = ""; - arrowFull = ""; - wholeHeight = 0.45; - font = FONT_ACE; - sizeEx = 0.031; - soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; - soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; - soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; - maxHistoryDelay = 1.0; - class ScrollBar { - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - border = ""; - }; - class ComboScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; + arrowEmpty = ""; + arrowFull = ""; + wholeHeight = 0.45; + font = FONT_ACE; + sizeEx = 0.031; + soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect", 0.1, 1}; + soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand", 0.1, 1}; + soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse", 0.1, 1}; + maxHistoryDelay = 1; + + class ScrollBar { + color[] = {0.3, 0.3, 0.3, 0.6}; + colorActive[] = {0.3, 0.3, 0.3, 1}; + colorDisabled[] = {0.3, 0.3, 0.3, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = ""; + }; + class ComboScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {0.3, 0.3, 0.3, 0.6}; + colorActive[] = {0.3, 0.3, 0.3, 1}; + colorDisabled[] = {0.3, 0.3, 0.3, 0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; }; - - class ACE_gui_mapBase { - 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)"; - type = 100; // Use 100 to hide markers - style = 48; - shadow = 0; + 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)"; + type = 100; // Use 100 to hide markers + style = 48; + shadow = 0; - ptsPerSquareSea = 5; - ptsPerSquareTxt = 3; - ptsPerSquareCLn = 10; - ptsPerSquareExp = 10; - ptsPerSquareCost = 10; - ptsPerSquareFor = 9; - ptsPerSquareForEdge = 9; - ptsPerSquareRoad = 6; - ptsPerSquareObj = 9; - showCountourInterval = 0; - scaleMin = 0.001; - scaleMax = 1.0; - scaleDefault = 0.16; - maxSatelliteAlpha = 0.85; - alphaFadeStartScale = 0.35; - alphaFadeEndScale = 0.4; - colorBackground[] = {0.969,0.957,0.949,1.0}; - colorSea[] = {0.467,0.631,0.851,0.5}; - colorForest[] = {0.624,0.78,0.388,0.5}; - colorForestBorder[] = {0.0,0.0,0.0,0.0}; - colorRocks[] = {0.0,0.0,0.0,0.3}; - colorRocksBorder[] = {0.0,0.0,0.0,0.0}; - colorLevels[] = {0.286,0.177,0.094,0.5}; - colorMainCountlines[] = {0.572,0.354,0.188,0.5}; - colorCountlines[] = {0.572,0.354,0.188,0.25}; - colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6}; - colorCountlinesWater[] = {0.491,0.577,0.702,0.3}; - colorPowerLines[] = {0.1,0.1,0.1,1.0}; - colorRailWay[] = {0.8,0.2,0.0,1.0}; - colorNames[] = {0.1,0.1,0.1,0.9}; - colorInactive[] = {1.0,1.0,1.0,0.5}; - colorOutside[] = {0.0,0.0,0.0,1.0}; - colorTracks[] = {0.84,0.76,0.65,0.15}; - colorTracksFill[] = {0.84,0.76,0.65,1.0}; - colorRoads[] = {0.7,0.7,0.7,1.0}; - colorRoadsFill[] = {1.0,1.0,1.0,1.0}; - colorMainRoads[] = {0.9,0.5,0.3,1.0}; - colorMainRoadsFill[] = {1.0,0.6,0.4,1.0}; - colorGrid[] = {0.1,0.1,0.1,0.6}; - colorGridMap[] = {0.1,0.1,0.1,0.6}; - colorText[] = {1, 1, 1, 0.85}; -font = "RobotoCondensed"; -sizeEx = 0.0270000; -stickX[] = {0.20, {"Gamma", 1.00, 1.50} }; -stickY[] = {0.20, {"Gamma", 1.00, 1.50} }; -onMouseButtonClick = ""; -onMouseButtonDblClick = ""; + ptsPerSquareSea = 5; + ptsPerSquareTxt = 3; + 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.85; + alphaFadeStartScale = 0.35; + alphaFadeEndScale = 0.4; + colorBackground[] = {0.969, 0.957, 0.949, 1}; + colorSea[] = {0.467, 0.631, 0.851, 0.5}; + colorForest[] = {0.624, 0.78, 0.388, 0.5}; + colorForestBorder[] = {0, 0, 0, 0}; + colorRocks[] = {0, 0, 0, 0.3}; + colorRocksBorder[] = {0, 0, 0, 0}; + colorLevels[] = {0.286, 0.177, 0.094, 0.5}; + colorMainCountlines[] = {0.572, 0.354, 0.188, 0.5}; + colorCountlines[] = {0.572, 0.354, 0.188, 0.25}; + colorMainCountlinesWater[] = {0.491, 0.577, 0.702, 0.6}; + colorCountlinesWater[] = {0.491, 0.577, 0.702, 0.3}; + colorPowerLines[] = {0.1, 0.1, 0.1, 1}; + colorRailWay[] = {0.8, 0.2, 0, 1}; + colorNames[] = {0.1, 0.1, 0.1, 0.9}; + colorInactive[] = {1, 1, 1, 0.5}; + colorOutside[] = {0, 0, 0, 1}; + colorTracks[] = {0.84, 0.76, 0.65, 0.15}; + colorTracksFill[] = {0.84, 0.76, 0.65, 1}; + colorRoads[] = {0.7, 0.7, 0.7, 1}; + colorRoadsFill[] = {1, 1, 1, 1}; + colorMainRoads[] = {0.9, 0.5, 0.3, 1}; + colorMainRoadsFill[] = {1, 0.6, 0.4, 1}; + colorGrid[] = {0.1, 0.1, 0.1, 0.6}; + colorGridMap[] = {0.1, 0.1, 0.1, 0.6}; + colorText[] = {1, 1, 1, 0.85}; + font = "RobotoCondensed"; + sizeEx = 0.027; + stickX[] = {0.2, {"Gamma", 1, 1.5}}; + stickY[] = {0.2, {"Gamma", 1, 1.5}}; + onMouseButtonClick = ""; + onMouseButtonDblClick = ""; - fontLabel = "RobotoCondensed"; - 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 = "RobotoCondensed"; - sizeExNames = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; - fontInfo = "RobotoCondensed"; - 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 ActiveMarker { - color[] = {0.30, 0.10, 0.90, 1.00}; - size = 50; - }; - 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 = "RobotoCondensed"; - 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.7,0.7,0.7,1}; - colorDone[] = {0.7,1,0.3,1}; - colorFailed[] = {1,0.3,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}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class WaypointCompleted { - icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - 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.45,0.64,0.33,0.4}; - 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.8}; - 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.45,0.64,0.33,0.4}; - 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.45,0.64,0.33,0.4}; - 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.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class fuelstation { - icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class hospital { - icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class church { - icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class lighthouse { - icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class power { - icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powersolar { - icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwave { - icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwind { - icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class quay { - icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class shipwreck { - icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class transmitter { - icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class watertower { - icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class Cross { - icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Chapel { - icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - 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.9; - 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.7; - 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}; - }; + fontLabel = "RobotoCondensed"; + 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 = "RobotoCondensed"; + sizeExNames = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + fontInfo = "RobotoCondensed"; + 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 ActiveMarker { + color[] = {0.3, 0.1, 0.9, 1}; + size = 50; + }; + 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 = "RobotoCondensed"; + 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.7, 0.7, 0.7, 1}; + colorDone[] = {0.7, 1, 0.3, 1}; + colorFailed[] = {1, 0.3, 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}; + size = 20; + importance = "1.2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + }; + class WaypointCompleted { + icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 20; + importance = "1.2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + }; + class CustomMark { + icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 24; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class Command { + icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + color[] = {1, 1, 1, 1}; + size = 18; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class Bush { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45, 0.64, 0.33, 0.4}; + 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.8}; + 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.45, 0.64, 0.33, 0.4}; + 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.45, 0.64, 0.33, 0.4}; + 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"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class fuelstation { + icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class hospital { + icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class church { + icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class lighthouse { + icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class power { + icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class powersolar { + icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class powerwave { + icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class powerwind { + icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class quay { + icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class shipwreck { + icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class transmitter { + icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class watertower { + icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class Cross { + icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; + color[] = {0, 0, 0, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class Chapel { + icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; + color[] = {0, 0, 0, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class Bunker { + icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 14; + importance = "1.5 * 14 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Fortress { + icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "2 * 16 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Fountain { + icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 11; + importance = "1 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Ruin { + icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "1.2 * 16 * 0.05"; + coefMin = 1; + coefMax = 4; + }; + class Stack { + icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 20; + importance = "2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + }; + class Tourism { + icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "1 * 16 * 0.05"; + coefMin = 0.7; + coefMax = 4; + }; + class ViewTower { + icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "2.5 * 16 * 0.05"; + coefMin = 0.5; + coefMax = 4; + }; }; #endif diff --git a/addons/common/dev/test_cfgPatches.sqf b/addons/common/dev/test_cfgPatches.sqf index bd00869360..e2ce10b2c6 100644 --- a/addons/common/dev/test_cfgPatches.sqf +++ b/addons/common/dev/test_cfgPatches.sqf @@ -13,16 +13,16 @@ private _allPatches = "(configName _x) select [0,3] == 'ace'" configClasses (con // Get all units[] private _allUnits = []; { - _allUnits append ((getArray (_x >> "units")) apply { toLower _x }); + _allUnits append ((getArray (_x >> "units")) apply { toLowerANSI _x }); } forEach _allPatches; { private _class = configFile >> "CfgVehicles" >> _x; if (isNull _class) then { - WARNING_1("in units[] but null - %1", _x); + WARNING_1("in units[] but null - %1",_x); _testPass = false; } else { // if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then { - // WARNING_2("in units[] but not public - %1 from %2", configName _class, configSourceMod _class); + // WARNING_2("in units[] but not public - %1 from %2",configName _class,configSourceMod _class); // _testPass = false; // }; }; @@ -31,16 +31,16 @@ private _allUnits = []; // Get all weapons[] private _allWeapons = []; { - _allWeapons append ((getArray (_x >> "weapons")) apply { toLower _x }); + _allWeapons append ((getArray (_x >> "weapons")) apply { toLowerANSI _x }); } forEach _allPatches; { private _class = configFile >> "CfgWeapons" >> _x; if (isNull _class) then { - WARNING_1("in weapons[] but null - %1", _x); + WARNING_1("in weapons[] but null - %1",_x); _testPass = false; } else { // if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then { - // WARNING_2("in weapons[] but not public - %1 from %2", configName _class, configSourceMod _class); + // WARNING_2("in weapons[] but not public - %1 from %2",configName _class,configSourceMod _class); // _testPass = false; // }; }; @@ -50,8 +50,8 @@ private _allWeapons = []; private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgVehicles"); { if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then { - if (!((toLower configName _x) in _allUnits)) then { - WARNING_2("Not in any units[] - %1 from %2", configName _x, configSourceMod _x); + if (!((toLowerANSI configName _x) in _allUnits)) then { + WARNING_2("Not in any units[] - %1 from %2",configName _x,configSourceMod _x); _testPass = false; }; }; @@ -60,10 +60,10 @@ private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFil // Check if all public weapons are defined in a cfgPatch private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgWeapons"); { - private _type = toLower configName _x; + private _type = toLowerANSI configName _x; if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then { - if (!((toLower configName _x) in _allWeapons)) then { - WARNING_2("Not in any weapons[] - %1 from %2", configName _x, configSourceMod _x); + if (!((toLowerANSI configName _x) in _allWeapons)) then { + WARNING_2("Not in any weapons[] - %1 from %2",configName _x,configSourceMod _x); _testPass = false; }; }; diff --git a/addons/common/dev/test_vehicleInventory.sqf b/addons/common/dev/test_vehicleInventory.sqf index 7fdd0159c0..9fb24fc1d6 100644 --- a/addons/common/dev/test_vehicleInventory.sqf +++ b/addons/common/dev/test_vehicleInventory.sqf @@ -14,7 +14,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x) private _glassesConfig = configFile >> "CfgGlasses" >> _name; if (((!isClass _weaponConfig) || {(getNumber (_weaponConfig >> "type")) in [1,2,4]}) && {!isClass _glassesConfig}) then { diag_log text format ["%1 -> TransportItems -> %2 = Bad", _vehType, _name]; - if ("ace" in toLower (_vehType + _name)) then { _testPass = false; }; + if ("ace" in toLowerANSI (_vehType + _name)) then { _testPass = false; }; }; }; } forEach (configProperties [_x >> "TransportItems", "isClass _x", true]); @@ -23,7 +23,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x) private _weaponConfig = configFile >> "CfgWeapons" >> _name; if ((!isClass _weaponConfig) || {!((getNumber (_weaponConfig >> "type")) in [1,2,4])}) then { diag_log text format ["%1 -> TransportWeapons -> %2 = Bad", _vehType, _name]; - if ("ace" in toLower (_vehType + _name)) then { _testPass = false; }; + if ("ace" in toLowerANSI (_vehType + _name)) then { _testPass = false; }; }; } forEach (configProperties [_x >> "TransportWeapons", "isClass _x", true]); { @@ -31,7 +31,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x) private _magConfig = configFile >> "CfgMagazines" >> _name; if ((!isClass _magConfig)) then { diag_log text format ["%1 -> TransportMagazines -> %2 = Bad", _vehType, _name]; - if ("ace" in toLower (_vehType + _name)) then { _testPass = false; }; + if ("ace" in toLowerANSI (_vehType + _name)) then { _testPass = false; }; }; } forEach (configProperties [_x >> "TransportMagazines", "isClass _x", true]); { @@ -39,7 +39,7 @@ private _vehicles = configProperties [configFile >> "CfgVehicles", "(isClass _x) private _vehConfig = configFile >> "CfgVehicles" >> _name; if ((!isClass _vehConfig)) then { diag_log text format ["%1 -> TransportBackpacks -> %2 = Bad", _vehType, _name]; - if ("ace" in toLower (_vehType + _name)) then { _testPass = false; }; + if ("ace" in toLowerANSI (_vehType + _name)) then { _testPass = false; }; }; } forEach (configProperties [_x >> "TransportBackpacks", "isClass _x", true]); } forEach _vehicles; diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index a5bb286768..1924ed22ff 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -27,7 +27,7 @@ if (isServer) then { params ["_eventName", "_client"]; if !(_eventName in GVAR(syncedEvents)) exitWith { - ERROR_1("Request for synced event - key [%1] not found.", _eventName); + ERROR_1("Request for synced event - key [%1] not found.",_eventName); false }; @@ -43,8 +43,7 @@ if (isServer) then { { _x params ["", "_eventArgs","_ttl"]; [_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent); - false - } count _eventLog; + } forEach _eventLog; INFO_1("[%1] synchronized",_eventName); }; diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index a7b28de1a6..aac8ac873e 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -20,7 +20,7 @@ params ["_name", "_args", "_ttl"]; if !(_name in GVAR(syncedEvents)) exitWith { - ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name); + ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).",_name); false }; diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index d9c4e3335d..3dce27cf55 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -18,7 +18,7 @@ params ["_conditionName", "_conditionFunc"]; -_conditionName = toLower _conditionName; +_conditionName = toLowerANSI _conditionName; private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; _conditions params ["_conditionNames", "_conditionFuncs"]; diff --git a/addons/common/functions/fnc_addSwayFactor.sqf b/addons/common/functions/fnc_addSwayFactor.sqf index 7a258bc12a..1cdc6fb721 100644 --- a/addons/common/functions/fnc_addSwayFactor.sqf +++ b/addons/common/functions/fnc_addSwayFactor.sqf @@ -18,7 +18,7 @@ */ params ["_type", "_code", "_id"]; -_type = toLower _type; +_type = toLowerANSI _type; if !(_type in ["baseline", "multiplier"]) exitWith { ERROR_2("%1-%2 type unsupported",_type,_id); false }; diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index dbe0612e95..616897842b 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -24,7 +24,7 @@ if (_name in GVAR(syncedEvents)) exitWith { false }; -private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler; +private _eventId = [_name, LINKFUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler; private _data = [_handler, [], _ttl, _eventId]; GVAR(syncedEvents) set [_name, _data]; diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 39e6903390..9902abe82b 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Garth 'L-H' de Wet - * Adds an item, weapon, or magazine to the unit's inventory or places it in a weaponHolder if no space. + * Adds an item, weapon, or magazine to the unit's inventory or places it in a weapon holder if no space. * * Arguments: * 0: Unit @@ -11,10 +11,10 @@ * * Return Value: * 0: Added to player - * 1: weaponholder + * 1: Weapon holder item was placed in * * Example: - * [bob, "classname", "", 5] call ace_common_fnc_addToInventory + * [player, "30Rnd_65x39_caseless_mag", "", 5] call ace_common_fnc_addToInventory * * Public: Yes */ @@ -26,6 +26,7 @@ private _type = _classname call FUNC(getItemType); private _canAdd = false; private _canFitWeaponSlot = false; private _addedToUnit = false; +private _weaponHolder = _unit; switch (_container) do { case "vest": { @@ -94,11 +95,13 @@ switch (_type select 0) do { } else { _addedToUnit = false; - private _pos = _unit modelToWorldVisual [0,1,0.05]; + _weaponHolder = nearestObject [_unit, "WeaponHolder"]; - _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; - _unit addWeaponCargoGlobal [_classname, 1]; - _unit setPosATL _pos; + if (isNull _weaponHolder || {_unit distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", _unit, [], 0, "CAN_COLLIDE"]; + }; + + _weaponHolder addWeaponCargoGlobal [_classname, 1]; }; }; @@ -112,13 +115,13 @@ switch (_type select 0) do { switch (_container) do { case "vest": { - _unit addItemToVest _classname; //@todo Bug! A full magazine, ignoring ammo. No such command. + (vestContainer _unit) addMagazineAmmoCargo [_classname, 1, _ammoCount]; }; case "backpack": { - _unit addItemToBackpack _classname; //@todo Bug! A full magazine, ignoring ammo. No such command. + (backpackContainer _unit) addMagazineAmmoCargo [_classname, 1, _ammoCount]; }; case "uniform": { - _unit addItemToUniform _classname; //@todo Bug! A full magazine, ignoring ammo. No such command. + (uniformContainer _unit) addMagazineAmmoCargo [_classname, 1, _ammoCount]; }; default { _unit addMagazine [_classname, _ammoCount]; @@ -127,11 +130,13 @@ switch (_type select 0) do { } else { _addedToUnit = false; - private _pos = _unit modelToWorldVisual [0,1,0.05]; + _weaponHolder = nearestObject [_unit, "WeaponHolder"]; - _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; - _unit addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. - _unit setPosATL _pos; + if (isNull _weaponHolder || {_unit distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", _unit, [], 0, "CAN_COLLIDE"]; + }; + + _weaponHolder addMagazineAmmoCargo [_classname, 1, _ammoCount]; }; }; @@ -156,11 +161,13 @@ switch (_type select 0) do { } else { _addedToUnit = false; - private _pos = _unit modelToWorldVisual [0,1,0.05]; + _weaponHolder = nearestObject [_unit, "WeaponHolder"]; - _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; - _unit addItemCargoGlobal [_classname, 1]; - _unit setPosATL _pos; + if (isNull _weaponHolder || {_unit distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", _unit, [], 0, "CAN_COLLIDE"]; + }; + + _weaponHolder addItemCargoGlobal [_classname, 1]; }; }; @@ -170,4 +177,4 @@ switch (_type select 0) do { }; }; -[_addedToUnit, _unit] +[_addedToUnit, _weaponHolder] diff --git a/addons/common/functions/fnc_adjustMagazineAmmo.sqf b/addons/common/functions/fnc_adjustMagazineAmmo.sqf new file mode 100644 index 0000000000..87d5b9e899 --- /dev/null +++ b/addons/common/functions/fnc_adjustMagazineAmmo.sqf @@ -0,0 +1,107 @@ +#include "..\script_component.hpp" +/* + * Author: Katalam, Blue, Brett Mayson, johnb43 + * Handle adjusting a magazine's ammo + * + * Arguments: + * 0: Vehicle or Unit + * 1: Item + * 2: Ammo to adjust by (default: -1) + * + * Return Value: + * How much the ammo was adjusted by + * + * Example: + * [player, "30Rnd_556x45_Stanag", 1] call ace_common_fnc_adjustMagazineAmmo; + * + * Public: No + */ + +params ["_unit", "_magazine", ["_count", -1]]; + +if (_count == 0) exitWith {0}; + +private _containers = if (_unit isKindOf "CAManBase") then { + [uniformContainer _unit, vestContainer _unit, backpackContainer _unit] +} else { + [_unit] +}; + +scopeName "main"; + +private _originalCount = _count; +private _container = objNull; +private _magazinesContainer = []; +private _newAmmoCount = 0; +private _removeAmmo = _count < 0; +private _maxMagazineAmmo = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); + +{ + _container = _x; + + // Get all magazines of _magazine type + _magazinesContainer = (magazinesAmmoCargo _container) select {_x select 0 == _magazine}; + + // Get the ammo count, filter out magazines with 0 ammo + _magazinesContainer = (_magazinesContainer apply {_x select 1}) select {_x != 0}; + + // If there are none, skip to next container + if (_magazinesContainer isEqualTo []) then { + continue; + }; + + // Sort, smallest first when removing, largest first when adding + _magazinesContainer sort _removeAmmo; + + if (_removeAmmo) then { + { + _count = _x + _count; + + _container addMagazineAmmoCargo [_magazine, -1, _x]; + + if (_count >= 0) then { + // Only add magazine back if it's not empty + if (_count != 0) then { + _container addMagazineAmmoCargo [_magazine, 1, _count]; + }; + + _originalCount breakOut "main"; + }; + } forEach _magazinesContainer; + } else { + // This loop only fills up partially filled magazines + { + // Fill the magazine to either its max or until all ammo has been added + _newAmmoCount = (_x + _count) min _maxMagazineAmmo; + + if (_newAmmoCount <= _maxMagazineAmmo) then { + _container addMagazineAmmoCargo [_magazine, -1, _x]; + _container addMagazineAmmoCargo [_magazine, 1, _newAmmoCount]; + }; + + // Remove the ammo that was added + _count = _count - (_newAmmoCount - _x); + + if (_count <= 0) then { + _originalCount breakOut "main"; + }; + } forEach (_magazinesContainer select {_x < _maxMagazineAmmo}); + }; +} forEach _containers; + +// If there is still remaining ammo to add, try add it after having iterated through all containers +if (!_removeAmmo && _count > 0) then { + { + while {_count > 0 && {_x canAdd [_magazine, 1/* 2.18 , true*/]}} do { + _x addMagazineAmmoCargo [_magazine, 1, _count]; + + _count = _count - _maxMagazineAmmo; + }; + } forEach _containers; + + if (_count <= 0) then { + _originalCount breakOut "main"; + }; +}; + +_originalCount - _count diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf index 23d373c310..0928812cd4 100644 --- a/addons/common/functions/fnc_assignObjectsInList.sqf +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -28,18 +28,13 @@ if (_list isEqualType "") then { }; { - if (!isNil "_x") then { - if (_x isEqualType objNull) then { - if (local _x) then { - if (_vehicle) then { - (vehicle _x) setVariable [_variable, _setting, _global]; - TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global); - } else { - _x setVariable [_variable, _setting, _global]; - TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global); - }; - }; + if (!isNil "_x" && {_x isEqualType objNull} && {local _x}) then { + if (_vehicle) then { + (vehicle _x) setVariable [_variable, _setting, _global]; + TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global); + } else { + _x setVariable [_variable, _setting, _global]; + TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global); }; }; - false -} count _list; +} forEach _list; diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index 0062aec1f3..dbf81b7676 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -9,7 +9,7 @@ * 2: Namespace to store the cache on * 3: Cache uid * 4: Max duration of the cache - * 5: Event that clears the cache (default: nil) + * 5: Events that clear the cache (default: nil) * * Return Value: * Result of the function @@ -20,41 +20,46 @@ * Public: No */ -params ["_params", "_function", "_namespace", "_uid", "_duration", "_event"]; +params ["_params", "_function", "_namespace", "_uid", "_duration", "_events"]; if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then { _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]]; // Does the cache need to be cleared on an event? - if (!isNil "_event") then { - private _varName = format [QGVAR(clearCache_%1), _event]; - private _cacheList = missionNamespace getVariable _varName; - - // If there was no EH to clear these caches, add one - if (isNil "_cacheList") then { - _cacheList = []; - missionNamespace setVariable [_varName, _cacheList]; - - [_event, { - #ifdef DEBUG_MODE_FULL - INFO_1("Clear cached variables on event: %1",_eventName); - #endif - // Get the list of caches to clear - //IGNORE_PRIVATE_WARNING ["_eventName"]; - // _eventName is defined on the function that calls the event - private _varName = format [QGVAR(clearCache_%1), _eventName]; - private _cacheList = missionNamespace getVariable [_varName, []]; - // Erase all the cached results - { - _x call FUNC(eraseCache); - } forEach _cacheList; - // Empty the list - missionNamespace setVariable [_varName, []]; - }] call CBA_fnc_addEventHandler; + if (!isNil "_events") then { + if (_events isEqualType "") then { + _events = [_events]; }; + { + private _event = _x; + private _varName = format [QGVAR(clearCache_%1), _event]; + private _cacheList = missionNamespace getVariable _varName; - // Add this cache to the list of the event - _cacheList pushBack [_namespace, _uid]; + // If there was no EH to clear these caches, add one + if (isNil "_cacheList") then { + _cacheList = []; + missionNamespace setVariable [_varName, _cacheList]; + + [_event, { + #ifdef DEBUG_MODE_FULL + INFO_1("Clear cached variables on event: %1",_eventName); + #endif + // Get the list of caches to clear + //IGNORE_PRIVATE_WARNING ["_eventName"]; + // _eventName is defined on the function that calls the event + private _varName = format [QGVAR(clearCache_%1), _eventName]; + private _cacheList = missionNamespace getVariable [_varName, []]; + // Erase all the cached results + { + _x call FUNC(eraseCache); + } forEach _cacheList; + // Empty the list + missionNamespace setVariable [_varName, []]; + }] call CBA_fnc_addEventHandler; + }; + // Add this cache to the list of the event + _cacheList pushBack [_namespace, _uid]; + } forEach _events; }; #ifdef DEBUG_MODE_FULL diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index d78e623d7b..777f3103a5 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -24,7 +24,7 @@ params ["_unit", "_vehicle", "_position", ["_checkDistance", false], ["_index", -1]]; -_position = toLower _position; +_position = toLowerANSI _position; // general if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 4cbcb1c19d..dd684d0619 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -19,7 +19,7 @@ params ["_unit", "_target", ["_exceptions", []]]; -_exceptions = _exceptions apply {toLower _x}; +_exceptions = _exceptions apply {toLowerANSI _x}; private _owner = _target getVariable [QGVAR(owner), objNull]; diff --git a/addons/common/functions/fnc_cbaSettings.sqf b/addons/common/functions/fnc_cbaSettings.sqf index 3e6f66fa42..29e4d532b1 100644 --- a/addons/common/functions/fnc_cbaSettings.sqf +++ b/addons/common/functions/fnc_cbaSettings.sqf @@ -66,8 +66,7 @@ GVAR(settingsMovedToSQF) = []; INFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized)); { (_x select 1) call (_x select 0); - false - } count GVAR(runAtSettingsInitialized); + } forEach GVAR(runAtSettingsInitialized); GVAR(runAtSettingsInitialized) = nil; //cleanup #ifdef DEBUG_MODE_FULL @@ -104,7 +103,7 @@ TRACE_1("Reading settings from missionConfigFile",_countOptions); for "_index" from 0 to (_countOptions - 1) do { private _optionEntry = _missionSettingsConfig select _index; private _settingName = configName _optionEntry; - if ((toLower _settingName) in GVAR(cbaSettings_forcedSettings)) then { + if ((toLowerANSI _settingName) in GVAR(cbaSettings_forcedSettings)) then { WARNING_1("Setting [%1] - Already Forced - ignoring missionConfig",_varName); } else { if ((isNil _settingName) && {(getNumber (_settingsConfig >> _settingName >> "movedToSQF")) == 0}) then { diff --git a/addons/common/functions/fnc_cbaSettings_convertHelper.sqf b/addons/common/functions/fnc_cbaSettings_convertHelper.sqf index 4597cf3d40..02fdfa0193 100644 --- a/addons/common/functions/fnc_cbaSettings_convertHelper.sqf +++ b/addons/common/functions/fnc_cbaSettings_convertHelper.sqf @@ -22,7 +22,7 @@ private _output = [format ["// CBA Settings [ADDON: %1]:", _addon]]; private _addonSearch = _addon + "_"; private _addonSearchCount = count _addonSearch; -TRACE_2("",_addonSearch, _addonSearchCount); +TRACE_2("",_addonSearch,_addonSearchCount); private _settings = configProperties [configFile >> "ACE_Settings", "(isClass _x) && {((configName _x) select [0, _addonSearchCount]) == _addonSearch}"]; @@ -44,7 +44,7 @@ private _settings = configProperties [configFile >> "ACE_Settings", "(isClass _x private _cbaIsGlobal = (!_isClientSettable) || _isForced; private _warnIfChangedMidMission = _cbaIsGlobal && {(getNumber (_config >> "canBeChanged")) == 0}; - if (_isForced) then {GVAR(cbaSettings_forcedSettings) pushBack (toLower _varName);}; + if (_isForced) then {GVAR(cbaSettings_forcedSettings) pushBack (toLowerANSI _varName);}; // Basic handling of setting types CBA doesn't support: if (_typeName == "ARRAY") exitWith { diff --git a/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf b/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf index d3a6f29f84..57b93c9963 100644 --- a/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf +++ b/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf @@ -34,7 +34,7 @@ private _category = getText (_config >> "category"); private _cbaIsGlobal = (!_isClientSettable) || _isForced; private _warnIfChangedMidMission = _cbaIsGlobal && {(getNumber (_config >> "canBeChanged")) == 0}; -if (_isForced) then {GVAR(cbaSettings_forcedSettings) pushBack (toLower _varName);}; +if (_isForced) then {GVAR(cbaSettings_forcedSettings) pushBack (toLowerANSI _varName);}; // Basic handling of setting types CBA doesn't support: if (_typeName == "ARRAY") exitWith { @@ -103,4 +103,3 @@ private _return = [_varName, _cbaSettingType, [_localizedName, _localizedDescrip TRACE_1("returned",_return); if ((isNil "_return") || {!_return}) then {ERROR_1("Setting [%1] - CBA Error",_varName);}; _return - diff --git a/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf b/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf index eaa9d089fc..8b6e62cbf6 100644 --- a/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf +++ b/addons/common/functions/fnc_cbaSettings_transferUserSettings.sqf @@ -34,7 +34,7 @@ private _aceSettings = configProperties [configFile >> "ACE_Settings", "isClass if (_isClientSettable && {_currentValue isNotEqualTo _profileVar}) then { // CBA_settings_fnc_set will do type checking for the old profile var private _ret = [_settingName, _profileVar, 0, "client", true] call CBA_settings_fnc_set; - INFO_3("Transfering setting [%1: %2] returned %3", _settingName, _profileVar, _ret); + INFO_3("Transfering setting [%1: %2] returned %3",_settingName,_profileVar,_ret); }; }; } forEach _aceSettings; diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 8b00cad533..39e2bac3ac 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -40,7 +40,7 @@ if ([_cbaRequiredAr, _cbaVersionAr] call cba_versioning_fnc_version_compare) the }; //private _addons = activatedAddons; // broken with High-Command module, see #2134 -private _addons = (cba_common_addons select {(_x select [0,4]) == "ace_"}) apply {toLower _x}; +private _addons = (cba_common_addons select {(_x select [0,4]) == "ace_"}) apply {toLowerANSI _x}; private _oldAddons = []; private _oldSources = []; private _oldCompats = []; @@ -80,14 +80,14 @@ if (_oldCompats isNotEqualTo []) then { _oldCompats = _oldCompats apply {format ["%1 (%2)", _x select 0, _x select 1]}; [{ // Lasts for ~10 seconds - ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated", "%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2); + ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated","%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2); }, [_oldCompats, _mainVersion, _mainSource], 1] call CBA_fnc_waitAndExecute; }; /////////////// // check extensions /////////////// -private _platform = toLower (productVersion select 6); +private _platform = toLowerANSI (productVersion select 6); if (!isServer && {_platform in ["linux", "osx"]}) then { // Linux and OSX client ports do not support extensions at all INFO("Operating system does not support extensions"); diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index f69f486d5e..cb192c6667 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -25,7 +25,7 @@ params ["_mode", ["_checkAll", false], ["_whitelist", "", [""]]]; TRACE_3("params",_mode,_checkAll,_whitelist); //lowercase and convert whiteList String into array of strings: -_whitelist = toLower _whitelist; +_whitelist = toLowerANSI _whitelist; _whitelist = _whitelist splitString "[,""']"; TRACE_1("Array",_whitelist); diff --git a/addons/common/functions/fnc_claimSafeServer.sqf b/addons/common/functions/fnc_claimSafeServer.sqf index e24a421549..6ebee7cb4f 100644 --- a/addons/common/functions/fnc_claimSafeServer.sqf +++ b/addons/common/functions/fnc_claimSafeServer.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2, PabstMirror - * Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc. + * Unit claims the ownership over an object. This is used to prevent multiple players from dragging the same ammo box or using up the same wheel when repairing etc. * This function only runs on the server and handles the "ace_common_claimSafe" event. It provides a network safe way claiming objects as all claims are run on server. * Return event is passed [_unit, _target, _success] for new claims, no event on claim release * diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 4037a168b7..8db3c7e811 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -1,7 +1,8 @@ #include "..\script_component.hpp" #include "\a3\ui_f_curator\ui\defineResinclDesign.inc" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" /* - * Author: commy2 + * Author: commy2, johnb43 * Disables key input. ESC can still be pressed to open the menu. * * Arguments: @@ -27,7 +28,7 @@ if (_state) then { if (!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])) exitWith {}; if (!isNil QGVAR(disableInputPFH)) exitWith {}; - // end TFAR and ACRE2 radio transmissions + // End TFAR and ACRE2 radio transmissions call FUNC(endRadioTransmission); // Close map @@ -45,38 +46,120 @@ if (_state) then { private _map = _display displayCtrl 101; _map ctrlMapCursor ["", QGVAR(blank)]; + GVAR(keyboardInputMain) = createHashMap; + GVAR(keyboardInputCombo) = createHashMap; + _display displayAddEventHandler ["KeyDown", { + // If input is enabled again, ignore + if (isNil QGVAR(keyboardInputMain)) exitWith {}; + params ["", "_key"]; - if (_key == 1 && {alive player}) then { - createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); + // Get key info; Stored as [isPressed, pressedCount] + private _keyPressedInfo = GVAR(keyboardInputMain) getOrDefault [_key, [false, 0], true]; + _keyPressedInfo params ["_keyPressed", "_keyPressedCount"]; + // For regular keys: If pressed, set to release and remove one key press + if (!_keyPressed) then { + _keyPressedInfo set [0, true]; + _keyPressedInfo set [1, _keyPressedCount + 1]; + }; + + // For combo keys, register only if pushed or released (no keypress count) + if !(GVAR(keyboardInputCombo) getOrDefault [_key, false]) then { + GVAR(keyboardInputCombo) set [_key, true]; + }; + + // Look if keybinds of various actions have been pressed + private _action = ""; + private _comboDikPressed = false; + private _return = false; + + // This technique has a limitation: It can't process the Escape key properly (KeyUp EH does not fire) + (["TeamSwitch", "CuratorInterface", "ShowMap", "DefaultAction", "Throw", "Chat", "PrevChannel", "NextChannel"] apply { + _action = _x; + + { + _x params ["_mainKeyArray", "_comboKeyArray", "_isDoubleTap"]; + _mainKeyArray params ["_mainDik", "_mainDevice"]; + + // If keybind doesn't contain key combo, it returns empty array; Therefore, return true + _comboDikPressed = if (_comboKeyArray isEqualTo []) then { + true + } else { + _comboKeyArray params ["_comboDik", "_comboDevice"]; + + _comboDevice == "KEYBOARD" && {GVAR(keyboardInputCombo) getOrDefault [_comboDik, false]} + }; + + // Check if the necessary keys were pressed for a keybind + _return = _comboDikPressed && + {_mainDevice == "KEYBOARD"} && + {((GVAR(keyboardInputMain) getOrDefault [_mainDik, [false, 0]]) select 1) > (parseNumber _isDoubleTap)}; // check how many times the main key was pressed + + // Keybind was detected + if (_return) exitWith { + TRACE_1("Action triggered: ",_action); + }; + } forEach (actionKeysEx _action); + + _return + }) params ["_teamSwitch", "_curatorInterface", "_showMap", "_defaultAction", "_throw", "_chat", "_prevChannel", "_nextChannel"]; + + // Handle Escape separately because of limitation mentioned above + if (_key == DIK_ESCAPE && {alive player}) then { disableSerialization; + private _isMultiplayer = isMultiplayer; + private _is3DENPreview = is3DENPreview; + + createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select _isMultiplayer); + private _dlg = findDisplay 49; for "_index" from 100 to 2000 do { (_dlg displayCtrl _index) ctrlEnable false; }; - private _ctrl = _dlg displayctrl 103; - _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput))]; - _ctrl ctrlEnable true; - _ctrl ctrlSetText "ABORT"; - _ctrl ctrlSetTooltip "Abort."; + private _ctrl = _dlg displayCtrl 103; + _ctrl ctrlSetEventHandler ["ButtonClick", toString { + while {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} do { + closeDialog 0 + }; - _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); - if (["ace_medical"] call FUNC(isModLoaded)) then { - _ctrl ctrlSetEventHandler ["buttonClick", 'closeDialog 0; [player, "respawn_button"] call EFUNC(medical_status,setDead); [false] call DFUNC(disableUserInput);']; - } else { - _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput))]; - }; - _ctrl ctrlEnable ((getMissionConfigValue ["respawnButton", -1]) != 0); // handles 3den attribute or description.ext - _ctrl ctrlSetText localize "$str_3den_multiplayer_attributecategory_respawn_displayname"; - _ctrl ctrlSetTooltip "Respawn."; + failMission "LOSER"; + + [false] call FUNC(disableUserInput); + }]; + _ctrl ctrlEnable true; + _ctrl ctrlSetText localize (["str_disp_int_abort", "STR_3DEN_RscDisplayInterrupt_ButtonAbort_3DEN_text"] select (_is3DENPreview && !_isMultiplayer)); + _ctrl ctrlSetTooltip localize ([ + "STR_TOOLTIP_MAIN_ABORT_CAMPAIGN", + "STR_3DEN_RscDisplayInterrupt_ButtonAbort_3DEN_tooltip", + "STR_TOOLTIP_MAIN_ABORT" + ] select (([_is3DENPreview, _isMultiplayer] call FUNC(toBitmask)) min 2)); + + _ctrl = _dlg displayCtrl ([104, 1010] select _isMultiplayer); + _ctrl ctrlSetEventHandler ["ButtonClick", toString { + closeDialog 0; + + if (["ace_medical"] call FUNC(isModLoaded)) then { + [player, "respawn_button"] call EFUNC(medical_status,setDead); + } else { + player setDamage 1; + }; + + [false] call FUNC(disableUserInput); + }]; + + private _respawnEnabled = (getMissionConfigValue ["respawnButton", -1]) != 0; + + _ctrl ctrlEnable _respawnEnabled; // handles 3den attribute or description.ext + _ctrl ctrlSetText localize "str_disp_int_respawn"; + _ctrl ctrlSetTooltip localize (["str_3den_attributes_respawn_none_tooltip", "str_disp_int_respawn"] select _respawnEnabled); }; - if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then { + if (_teamSwitch && teamSwitchEnabled) then { (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; private _acc = accTime; @@ -84,18 +167,20 @@ if (_state) then { setAccTime _acc; }; - if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then { + if (_curatorInterface && {!isNull getAssignedCuratorLogic player}) then { (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + openCuratorInterface; }; - if (_key in actionKeys "ShowMap" && {player getVariable ["ACE_canSwitchUnits", false]}) then { + if (_showMap && {player getVariable ["ACE_canSwitchUnits", false]}) then { (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + openMap true; }; - if (isServer || {serverCommandAvailable "#kick"}) then { - if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then { + if (isMultiplayer && {isServer || {serverCommandAvailable "#kick"}}) then { + if (!(_defaultAction || _throw) && {_chat || _prevChannel || _nextChannel}) then { _key = 0; }; }; @@ -103,7 +188,41 @@ if (_state) then { _key > 0 }]; - _display displayAddEventHandler ["KeyUp", {true}]; + _display displayAddEventHandler ["KeyUp", { + // If input is enabled again, ignore + if (isNil QGVAR(keyboardInputMain)) exitWith {}; + + params ["", "_key"]; + + // For combo keys: If pressed, release + if (GVAR(keyboardInputCombo) getOrDefault [_key, false]) then { + GVAR(keyboardInputCombo) deleteAt _key; + }; + + private _keyPressedInfo = GVAR(keyboardInputMain) getOrDefault [_key, [false, 0]]; + + // If pressed, release it + if (_keyPressedInfo select 0) then { + _keyPressedInfo set [0, false]; + }; + + // Cache keystrokes of regular keys for a small amount of time + [{ + // If input is enabled again, ignore + if (isNil QGVAR(keyboardInputMain)) exitWith {}; + + params ["_key"]; + + private _keyPressedInfo = GVAR(keyboardInputMain) getOrDefault [_key, [false, 0]]; + + // Release it + _keyPressedInfo set [1, ((_keyPressedInfo select 1) - 1) max 0]; + + if (_keyPressedInfo isEqualTo [false, 0]) then { + GVAR(keyboardInputMain) deleteAt _key; + }; + }, _key, 0.5] call CBA_fnc_waitAndExecute; + }]; }; GVAR(disableInputPFH) = [{ @@ -133,4 +252,7 @@ if (_state) then { }; (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + + GVAR(keyboardInputMain) = nil; + GVAR(keyboardInputCombo) = nil; }; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 1b307fdf33..da08fa832a 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -53,8 +53,7 @@ private _refresh = { { ctrlDelete _x; - false - } count _allControls; + } forEach _allControls; _allControls = []; @@ -80,7 +79,6 @@ private _refresh = { _ctrl ctrlSetTextColor _xcolor; _ctrl ctrlCommit 0; _allControls pushBack _ctrl; - false } forEach (missionNamespace getVariable [QGVAR(displayIconList),[]]); }; @@ -116,8 +114,7 @@ if (_show) then { if (_x select 0 != _iconId) then { _newList pushBack _x; }; - false - } count _list; + } forEach _list; missionNamespace setVariable [QGVAR(displayIconList), _newList]; call _refresh; diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 754b811314..87437c37e2 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -34,8 +34,7 @@ if (IS_ARRAY(_var)) then { { [_x, _depth] call FUNC(dumpArray); - false - } count _var; + } forEach _var; diag_log text format ["%1],", _pad]; }; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index fa0b4e4e6d..309b82c673 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -25,8 +25,7 @@ if (!isNil "ACE_PFH_COUNTER") then { private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)}; diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2]; - false - } count ACE_PFH_COUNTER; + } forEach ACE_PFH_COUNTER; }; diag_log text format ["ACE COUNTER RESULTS"]; @@ -50,8 +49,7 @@ diag_log text format ["-------------------------------------------"]; }; _iter = _iter + 1; - false - } count _counterEntry; + } forEach _counterEntry; // results _averageResult = (_total / _count) * 1000; @@ -61,8 +59,7 @@ diag_log text format ["-------------------------------------------"]; } else { diag_log text format ["%1: No results", _counterEntry select 0]; }; - false -} count ACE_COUNTERS; +} forEach ACE_COUNTERS; /* // Dump PFH Trackers diff --git a/addons/common/functions/fnc_firedEH.sqf b/addons/common/functions/fnc_firedEH.sqf index 9a4c8e50d6..2c0c32994d 100644 --- a/addons/common/functions/fnc_firedEH.sqf +++ b/addons/common/functions/fnc_firedEH.sqf @@ -24,7 +24,7 @@ BEGIN_COUNTER(firedEH); params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; -TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile); +TRACE_7("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if (_unit isKindOf "CAManBase") then { // The unit it on foot @@ -50,8 +50,7 @@ if (_unit isKindOf "CAManBase") then { _gunner = _unit turretUnit _x; _turret = _x; }; - false - } count allTurrets [_unit, true]; + } forEach allTurrets [_unit, true]; // Ensure that at least the pilot is returned if there is no gunner if (isManualFire _unit && {isNull _gunner}) then { _gunner = effectiveCommander _unit; diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index 4e8aa1ec2a..8982d6bbad 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -17,6 +17,6 @@ params ["_unit"]; -if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {vehicle _unit == _unit}) then { +if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {isNull objectParent _unit}) then { [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); }; diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index 6642a09789..081836c196 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -35,7 +35,6 @@ private _return = []; _return pushBack [_x select 0, typeName _val, _val, _x select 2, _x select 5]; }; }; - false -} count GVAR(OBJECT_VARIABLES_STORAGE); +} forEach GVAR(OBJECT_VARIABLES_STORAGE); _return diff --git a/addons/common/functions/fnc_getConfigName.sqf b/addons/common/functions/fnc_getConfigName.sqf index 54ebf84343..3495014d55 100644 --- a/addons/common/functions/fnc_getConfigName.sqf +++ b/addons/common/functions/fnc_getConfigName.sqf @@ -17,7 +17,7 @@ params ["_className"]; -(uiNamespace getVariable QGVAR(configNames)) getOrDefaultCall [toLower _className, { +(uiNamespace getVariable QGVAR(configNames)) getOrDefaultCall [toLowerANSI _className, { private _config = configNull; { diff --git a/addons/common/functions/fnc_getCountOfItem.sqf b/addons/common/functions/fnc_getCountOfItem.sqf index 5667b6c980..5114f375d2 100644 --- a/addons/common/functions/fnc_getCountOfItem.sqf +++ b/addons/common/functions/fnc_getCountOfItem.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Dedmen + * Author: Dedmen, Blue, johnb43 * Return how many items of type _itemType the player has in his containers (Uniform, Vest, Backpack) * Doesn't count assignedItems, weapons, weapon attachments, magazines in weapons * @@ -19,13 +19,17 @@ params ["_unit", "_itemType"]; -private _countItemsInContainer = { - (getItemCargo _this) params ["_itemTypes", "_itemCounts"]; +private _count = 0; +private _isMagazine = isClass (configFile >> "CfgMagazines" >> _itemType); - private _index = _itemTypes find _itemType; - _itemCounts param [_index, 0] -}; +{ + (if (_isMagazine) then { + getMagazineCargo _x + } else { + getItemCargo _x + }) params ["_itemTypes", "_itemCounts"]; -((uniformContainer _unit) call _countItemsInContainer) + -((vestContainer _unit) call _countItemsInContainer) + -((backpackContainer _unit) call _countItemsInContainer) + _count = _count + (_itemCounts param [_itemTypes find _itemType, 0]); +} forEach [uniformContainer _unit, vestContainer _unit, backpackContainer _unit]; + +_count diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 2b92e6ef10..18c6c93c07 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -27,9 +27,9 @@ if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState} private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions"); -TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg); +TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg); -if (vehicle _unit != _unit) then { +if (!isNull objectParent _unit) then { private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); for "_index" from 0 to (count _interpolateArray - 1) step 2 do { diff --git a/addons/common/functions/fnc_getDefaultAnim.sqf b/addons/common/functions/fnc_getDefaultAnim.sqf index 788fd2b6bd..bd294ba0c0 100644 --- a/addons/common/functions/fnc_getDefaultAnim.sqf +++ b/addons/common/functions/fnc_getDefaultAnim.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -private _anim = toLower animationState _unit; +private _anim = toLowerANSI animationState _unit; // stance is broken for some animations. private _stance = stance _unit; diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf index fb652cfd1a..1b6f22152a 100644 --- a/addons/common/functions/fnc_getDoorTurrets.sqf +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -29,7 +29,6 @@ private _doorTurrets = []; if (((getNumber (_config >> "isCopilot")) == 0) && {count getArray (_config >> "weapons") > 0}) then { _doorTurrets pushBack _x; }; - false -} count _turrets; +} forEach _turrets; _doorTurrets diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index ffa0334a26..376f18070e 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -19,7 +19,7 @@ params [["_vehicle", objNull, [objNull]], ["_weapon", "", [""]]]; // on foot -if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle || {toLower _weapon in ["throw", "put"]}}) exitWith {gunner _vehicle}; +if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle || {toLowerANSI _weapon in ["throw", "put"]}}) exitWith {gunner _vehicle}; // inside vehicle private _gunner = objNull; @@ -28,8 +28,7 @@ private _gunner = objNull; if (_weapon in (_vehicle weaponsTurret _x)) exitWith { _gunner = _vehicle turretUnit _x; }; - false -} count allTurrets [_vehicle, true]; +} forEach allTurrets [_vehicle, true]; // ensure that at least the pilot is returned if there is no gunner if (isManualFire _vehicle && {isNull _gunner}) then { diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index fdbad3ee4a..076fd7a23c 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -23,7 +23,7 @@ params ["_unit", "_vehicle", "_position", ["_index", -1]]; -_position = toLower _position; +_position = toLowerANSI _position; // general if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; @@ -38,8 +38,7 @@ private _enemiesInVehicle = false; //Possible Side Restriction { if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; - false -} count crew _vehicle; +} forEach crew _vehicle; switch (_position) do { case "driver" : { diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index e39605f0cc..49f1b757da 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -67,7 +67,7 @@ switch (true) do { case (_type == TYPE_UNIFORM): {["item", "uniform"]}; case (_type == TYPE_BINOCULAR_AND_NVG): { - switch (toLower _simulation) do { + switch (toLowerANSI _simulation) do { case ("weapon"): {["weapon", "binocular"]}; case ("binocular"): {["weapon", "binocular"]}; case ("nvgoggles"): {["item", "nvgoggles"]}; @@ -78,7 +78,7 @@ switch (true) do { case (_type == TYPE_WEAPON_VEHICLE): {["weapon", "vehicle"]}; case (_type == TYPE_ITEM): { - switch (toLower _simulation) do { + switch (toLowerANSI _simulation) do { case ("itemmap"): {["item", "map"]}; case ("itemgps"): {["item", "gps"]}; case ("itemradio"): {["item", "radio"]}; diff --git a/addons/common/functions/fnc_getMapData.sqf b/addons/common/functions/fnc_getMapData.sqf index b4cb56d75f..379210ec8f 100644 --- a/addons/common/functions/fnc_getMapData.sqf +++ b/addons/common/functions/fnc_getMapData.sqf @@ -16,7 +16,7 @@ */ params ["_map"]; -_map = toLower _map; +_map = toLowerANSI _map; // [latitude, altitude] diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index f37e146288..daa4bd86cd 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -38,13 +38,12 @@ private _stepY = 1e10; _stepX = getNumber (_x >> "stepX"); _stepY = getNumber (_x >> "stepY"); }; - false -} count configProperties [_cfgGrid, "isClass _x", false]; +} forEach configProperties [_cfgGrid, "isClass _x", false]; private _letterGrid = false; -if (toLower _formatX find "a" != -1) then {_letterGrid = true}; -if (toLower _formatY find "a" != -1) then {_letterGrid = true}; +if (toLowerANSI _formatX find "a" != -1) then {_letterGrid = true}; +if (toLowerANSI _formatY find "a" != -1) then {_letterGrid = true}; if (_letterGrid) exitWith { WARNING_3("Map Grid Warning (%1) - Map uses letter grids [%2, %3]",worldName,_formatX,_formatY); diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index fc2c3d0605..b71e6729dd 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -25,8 +25,7 @@ if (_unit isKindOf "CAManBase") then { } else { { _return = _return + ({_x == _magazine} count magazines _x); - false - } count crew _unit; + } forEach crew _unit; (getMagazineCargo _unit) params [["_magNames", []], ["_magCount", []]]; { diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index 6f24b40f3e..7592bc8f33 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -25,7 +25,7 @@ private _pov = getText (_turret >> "memoryPointGunnerOptics"); private _gunBeg = getText (_turret >> "gunBeg"); private _gunEnd = getText (_turret >> "gunEnd"); -TRACE_3("", _pov, _gunBeg, _gunEnd); +TRACE_3("",_pov,_gunBeg,_gunEnd); // Pull the PIP pov or barrel direction, depending on how the model is set up private _povPos = _vehicle modelToWorldVisualWorld (_vehicle selectionPosition _pov); diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index dcbaafb3b2..75deced412 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -24,7 +24,6 @@ scopeName "main"; { if (_unit == (_vehicle turretUnit _x)) then {_x breakOut "main"}; - nil -} count allTurrets [_vehicle, true]; +} forEach allTurrets [_vehicle, true]; [] diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf index 00a90b1ab2..a1bc06f6ab 100644 --- a/addons/common/functions/fnc_getVehicleCrew.sqf +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -29,11 +29,10 @@ private _crew = []; }; } else { // otherwise check if we search for that type. toLower, because fullCrew returns "driver" vs. "Turret". - if (toLower (_x select 1) in _types) then { + if (toLowerANSI (_x select 1) in _types) then { _crew pushBack (_x select 0); }; }; - false -} count fullCrew _vehicle; +} forEach fullCrew _vehicle; _crew diff --git a/addons/common/functions/fnc_getVehicleIcon.sqf b/addons/common/functions/fnc_getVehicleIcon.sqf index 208bb144d8..c63d54a8d8 100644 --- a/addons/common/functions/fnc_getVehicleIcon.sqf +++ b/addons/common/functions/fnc_getVehicleIcon.sqf @@ -32,7 +32,7 @@ if (isNil "_cachedValue") then { private _vehicleIconValue = getText (configfile >> "CfgVehicleIcons" >> _vehicleValue); if (_vehicleIconValue == "") then { - if (_vehicleValue != "" && {((toLower _vehicleValue) find ".paa") > -1}) then { + if (_vehicleValue != "" && {((toLowerANSI _vehicleValue) find ".paa") > -1}) then { _cachedValue = _vehicleValue; } else { _cachedValue = DEFAULT_TEXTURE; diff --git a/addons/common/functions/fnc_getVehicleUAVCrew.sqf b/addons/common/functions/fnc_getVehicleUAVCrew.sqf index 0ac91e644a..f991e08d57 100644 --- a/addons/common/functions/fnc_getVehicleUAVCrew.sqf +++ b/addons/common/functions/fnc_getVehicleUAVCrew.sqf @@ -17,4 +17,4 @@ params [["_vehicle", objNull, [objNull]]]; -crew _vehicle select {getText (configOf _x >> "simulation") == "UAVPilot"} // return +(crew _vehicle) select {unitIsUAV _x} // return diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index 55e260ef27..c1ca241cab 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -29,7 +29,6 @@ private _modes = []; if (_x == "this") then { _modes pushBack _weapon; }; - false -} count getArray (_config >> "modes"); +} forEach getArray (_config >> "modes"); _modes diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 7ccb016c7a..2fadbd23ea 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -42,7 +42,6 @@ private _ammo = _muzzles apply {0}; _ammo set [_index, _x select 1]; }; }; - false -} count magazinesAmmoFull _unit; +} forEach magazinesAmmoFull _unit; [_attachments, _muzzles, _magazines, _ammo]; diff --git a/addons/common/functions/fnc_getWeight.sqf b/addons/common/functions/fnc_getWeight.sqf index fd50c62c14..300a74d382 100644 --- a/addons/common/functions/fnc_getWeight.sqf +++ b/addons/common/functions/fnc_getWeight.sqf @@ -5,10 +5,10 @@ * * Arguments: * 0: The Unit (usually the player) - * 1: Force a return type + * 1: Return imperial units * * Return Value: - * The return value + * Weight string * * Example: * [player] call ace_common_fnc_getWeight diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index 881fad7669..303a413385 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -18,7 +18,7 @@ params ["_unit"]; // Animation changes even inside vehicle post-1.60 -if (stance _unit == "PRONE" || {vehicle _unit != _unit} || {_unit call EFUNC(common,isSwimming)}) exitWith {}; +if (stance _unit == "PRONE" || {!isNull objectParent _unit} || {_unit call EFUNC(common,isSwimming)}) exitWith {}; [ _unit, diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index fde230b0ca..35e1f07eba 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -28,8 +28,7 @@ if (isNil QGVAR(LSD_Vehicles)) then { if (_hSCount > 0) then { GVAR(LSD_Vehicles) pushBack [_x, _hSCount]; }; - nil -} count _units; +} forEach _units; if (isNil QGVAR(LSD_Colors)) then { GVAR(LSD_Colors) = [ @@ -51,8 +50,7 @@ if (isNil QGVAR(LSD_PFH)) then { for "_i" from 0 to (_hSCount - 1) do { _vehicle setObjectTexture [_i, GVAR(LSD_Colors) select _index]; }; - nil - } count GVAR(LSD_Vehicles); + } forEach GVAR(LSD_Vehicles); _index = ((_index + 1) % 7) mod count GVAR(LSD_Colors); (_this select 0) set [0, _index]; diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf index 93ceccf17d..a559994bfa 100644 --- a/addons/common/functions/fnc_parseList.sqf +++ b/addons/common/functions/fnc_parseList.sqf @@ -32,8 +32,7 @@ private _whitespaceList = []; } else { _whitespaceList pushBack ([_x] call CBA_fnc_trim); }; - false -} count _list; +} forEach _list; _list = _whitespaceList; TRACE_1("Whitespace List",_list); @@ -46,8 +45,7 @@ if (_checkNil) then { if (!isNil _x) then { _nilCheckedList pushBack (missionNamespace getVariable _x); }; - false - } count _list; + } forEach _list; _list = _nilCheckedList; }; diff --git a/addons/common/functions/fnc_playConfigSound3D.sqf b/addons/common/functions/fnc_playConfigSound3D.sqf index c282199365..1069cf0f18 100644 --- a/addons/common/functions/fnc_playConfigSound3D.sqf +++ b/addons/common/functions/fnc_playConfigSound3D.sqf @@ -22,7 +22,7 @@ params ["_soundClass", "_posASL", "_volume", "_distance"]; private _sound = getArray (configFile >> "CfgSounds" >> _soundClass >> "sound"); if (_sound isEqualTo []) exitWith { - ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array", _soundClass); + ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array",_soundClass); }; TRACE_2("sound",_soundClass,_sound); @@ -35,7 +35,7 @@ ISNILS(_distance,_cfgDistance); _fileName = _fileName select [1]; // add file extension .wss as default -if !(toLower (_fileName select [count _fileName - 4]) in [".wav", ".ogg", ".wss"]) then { +if !(toLowerANSI (_fileName select [count _fileName - 4]) in [".wav", ".ogg", ".wss"]) then { ADD(_fileName,".wss"); }; TRACE_5("vars",_fileName,_posASL,_volume,_pitch,_distance); diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index dc9ead397f..5f9678f97b 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -23,7 +23,7 @@ params ["_logic", "_settingName", "_moduleVariable"]; // Check if the variable is already defined if (isNil _settingName) exitWith { - ERROR_1("readSettingFromModule - param [%1] is not an ace_setting", _settingName); + ERROR_1("readSettingFromModule - param [%1] is not an ace_setting",_settingName); }; // Check if the parameter is defined in the module diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf index 2abb5fa73e..7273fc61ca 100644 --- a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -32,7 +32,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); // Check if the variable is already defined if (isNil _settingName) exitWith { - ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName); + ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting",_settingName); }; // The setting is not forced, so update the value @@ -52,7 +52,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); }; if (!_validValue) exitWith { - WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_settingType); + WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]",_settingName,_settingValue,_settingType); }; if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then { diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index 6c45fb8966..02a9379e6c 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -31,7 +31,7 @@ if (isLocalized _requestMessage) then { _requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)]; }; -hint format ["%1", _requestMessage]; // @todo ? +hint str _requestMessage; // @todo ? if (!isNil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then { terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT); diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 9cc3fda3c3..6c5e8b56b6 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -17,7 +17,7 @@ params ["_conditionName"]; -_conditionName = toLower _conditionName; +_conditionName = toLowerANSI _conditionName; private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 5aed6270f4..615f50ce49 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -18,7 +18,7 @@ params ["_name"]; if !(_name in GVAR(syncedEvents)) exitWith { - ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name); + ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler)",_name); false }; diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 4d9f42a13b..ef74724183 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -27,8 +27,7 @@ if (isPlayer _unit) then { // clear all disable user input { [_x, false] call FUNC(setDisableUserInputStatus); - false - } count GVAR(DISABLE_USER_INPUT_COLLECTION); + } forEach GVAR(DISABLE_USER_INPUT_COLLECTION); }; }; @@ -36,5 +35,4 @@ if (isPlayer _unit) then { if !(_x select 4) then { _unit setVariable [_x select 0, nil, _x select 3]; }; - false -} count ([_unit] call FUNC(getAllDefinedSetVariables)); +} forEach ([_unit] call FUNC(getAllDefinedSetVariables)); diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index 905353d8ab..ac22cd3fa0 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -24,6 +24,4 @@ _respawnVariables pushBack "ACE_PersistentFunctions"; { _unit setVariable [_x, _unit getVariable _x, true]; - false -} count _respawnVariables; -nil +} forEach _respawnVariables; diff --git a/addons/common/functions/fnc_rscObjectHelper.sqf b/addons/common/functions/fnc_rscObjectHelper.sqf index c7d1342de9..95ddb2f74b 100644 --- a/addons/common/functions/fnc_rscObjectHelper.sqf +++ b/addons/common/functions/fnc_rscObjectHelper.sqf @@ -30,7 +30,7 @@ private _bottomRightY = 1; private _return = []; -switch (toLower _func) do { +switch (toLowerANSI _func) do { case ("2d"): { _array params ["_pointX", "_z", "_pointY"]; diff --git a/addons/common/functions/fnc_runTests.sqf b/addons/common/functions/fnc_runTests.sqf index 946255c42f..4a449fb7eb 100644 --- a/addons/common/functions/fnc_runTests.sqf +++ b/addons/common/functions/fnc_runTests.sqf @@ -22,7 +22,7 @@ private _startTime = diag_tickTime; private _fails = []; private _total = 0; -INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest); +INFO_1("ace_common_fnc_runTests starting for [%1]",_specificTest); { private _testName = configName _x; @@ -41,8 +41,8 @@ INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest); }; } forEach (configProperties [configFile >> "ACE_Tests"]); -INFO_1("ace_common_fnc_runTests finished in %1 ms", (1000 * (diag_tickTime - _startTime)) toFixed 1); -INFO_2("[%1 / %2] Tests Passed", (_total - (count _fails)), _total); +INFO_1("ace_common_fnc_runTests finished in %1 ms",(1000 * (diag_tickTime - _startTime)) toFixed 1); +INFO_2("[%1 / %2] Tests Passed",(_total - (count _fails)),_total); if (_fails isNotEqualTo []) then { - INFO_1("Failed: %1", _fails); + INFO_1("Failed: %1",_fails); }; diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index c30cbe1292..7d0b2dd2f1 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -47,7 +47,6 @@ private _array = []; _array pushBack _x; }; }; - false -} count toArray _string; +} forEach toArray _string; toString _array // return diff --git a/addons/common/functions/fnc_setApproximateVariablePublic.sqf b/addons/common/functions/fnc_setApproximateVariablePublic.sqf index 3ef9595121..ebd4476de5 100644 --- a/addons/common/functions/fnc_setApproximateVariablePublic.sqf +++ b/addons/common/functions/fnc_setApproximateVariablePublic.sqf @@ -38,4 +38,4 @@ if (abs(_value - _oldValue) < _tolerance) exitWith {}; _object setVariable [_varName, _value, true]; _object setVariable [_oldVarName, _value]; -TRACE_2("Published variable:", _varName, _value); +TRACE_2("Published variable:",_varName,_value); diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 8b583849be..678e2bc057 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -34,7 +34,7 @@ if (_object isEqualTo (_object getVariable [format ["ACE_onEmbargo_%1", _varName _object setVariable [_varName, _value, true]; _object setVariable [format ["ACE_onEmbargo_%1", _varName], _object]; -TRACE_2("Starting Embargo", _varName, _delay); +TRACE_2("Starting Embargo",_varName,_delay); [{ params ["_object", "_varName", "_value"]; @@ -43,7 +43,7 @@ TRACE_2("Starting Embargo", _varName, _delay); _object setVariable [format ["ACE_onEmbargo_%1", _varName], nil]; //Remove Embargo private _curValue = _object getVariable _varName; - TRACE_4("End of embargo", _object, _varName, _value, _curValue); + TRACE_4("End of embargo",_object,_varName,_value,_curValue); //If value at start of embargo doesn't equal current, then broadcast and start new embargo if (_value isNotEqualTo _curValue) then { diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index da6f2e0975..1ca7ca8106 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -41,11 +41,11 @@ if (isArray (missionConfigFile >> "showHUD")) then { if (_reason != "") then { _reason = toLower _reason; if (_mask isEqualTo []) then { - TRACE_2("Removing", _reason, _mask); + TRACE_2("Removing",_reason,_mask); GVAR(showHudHash) deleteAt _reason; } else { while {(count _mask) < 10} do { _mask pushBack true; }; - TRACE_2("Setting", _reason, _mask); + TRACE_2("Setting",_reason,_mask); GVAR(showHudHash) set [_reason, _mask]; }; }; @@ -63,7 +63,7 @@ for "_index" from 0 to 9 do { _resultMask pushBack _set; }; -TRACE_2("showHud", _resultMask, keys GVAR(showHudHash)); +TRACE_2("showHud",_resultMask,keys GVAR(showHudHash)); showHud _resultMask; _resultMask diff --git a/addons/common/functions/fnc_statusEffect_addType.sqf b/addons/common/functions/fnc_statusEffect_addType.sqf index 959ae8c2ef..5535b0d914 100644 --- a/addons/common/functions/fnc_statusEffect_addType.sqf +++ b/addons/common/functions/fnc_statusEffect_addType.sqf @@ -5,8 +5,9 @@ * * Arguments: * 0: Status Effect Name, this should match a corresponding event name - * 1: Send event globaly + * 1: Send event globally * 2: Common Effect Reaons to pre-seed durring init + * 3: Send event to JIP (requires sending event globally) * * Return Value: * None @@ -17,18 +18,20 @@ * Public: No */ -params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]]]; +params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]], ["_sendJIP", false, [false]]]; TRACE_3("params",_name,_isGlobal,_commonReasonsArray); -if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1", _this)}; -if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1", _this)}; +if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1",_this)}; +if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1",_this)}; +if (_sendJIP && !_isGlobal) exitWith {WARNING_1("addStatusEffect - Trying to add non-global JIP effect %1",_this)}; GVAR(statusEffect_Names) pushBack _name; GVAR(statusEffect_isGlobal) pushBack _isGlobal; +GVAR(statusEffect_sendJIP) pushBack _sendJIP; //We add reasons at any time, but more efficenet to add all common ones at one time during init if (isServer && {_commonReasonsArray isNotEqualTo []}) then { //Switch case to lower: - _commonReasonsArray = _commonReasonsArray apply { toLower _x }; + _commonReasonsArray = _commonReasonsArray apply { toLowerANSI _x }; missionNamespace setVariable [(format [QGVAR(statusEffects_%1), _name]), _commonReasonsArray, true]; }; diff --git a/addons/common/functions/fnc_statusEffect_localEH.sqf b/addons/common/functions/fnc_statusEffect_localEH.sqf index f8ff93dba7..e60679350d 100644 --- a/addons/common/functions/fnc_statusEffect_localEH.sqf +++ b/addons/common/functions/fnc_statusEffect_localEH.sqf @@ -22,12 +22,12 @@ TRACE_2("params",_object,_isLocal); //Only run this after the settings are initialized //Need to wait for all EH to be installed (local event will happen between pre and post init) if !(GVAR(settingsInitFinished)) exitWith { - TRACE_1("pushing to runAtSettingsInitialized", _this); + TRACE_1("pushing to runAtSettingsInitialized",_this); GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_localEH), _this]; }; -if (!_isLocal) exitWith {TRACE_1("object no longer local", _this)}; -if (isNull _object) exitWith {TRACE_1("object null", _this)}; +if (!_isLocal) exitWith {TRACE_1("object no longer local",_this)}; +if (isNull _object) exitWith {TRACE_1("object null",_this)}; //Reset any variables because of respawn [_object, false] call FUNC(statusEffect_resetVariables); diff --git a/addons/common/functions/fnc_statusEffect_respawnEH.sqf b/addons/common/functions/fnc_statusEffect_respawnEH.sqf index 2c4a4840fe..edad032a9a 100644 --- a/addons/common/functions/fnc_statusEffect_respawnEH.sqf +++ b/addons/common/functions/fnc_statusEffect_respawnEH.sqf @@ -21,12 +21,12 @@ TRACE_1("params",_object); //Only run this after the settings are initialized //Need to wait for all EH to be installed (local event will happen between pre and post init) if !(GVAR(settingsInitFinished)) exitWith { - TRACE_1("pushing to runAtSettingsInitialized", _this); + TRACE_1("pushing to runAtSettingsInitialized",_this); GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_respawnEH), _this]; }; -if (!local _object) exitWith {TRACE_1("object no longer local", _this)}; -if (isNull _object) exitWith {TRACE_1("object null", _this)}; +if (!local _object) exitWith {TRACE_1("object no longer local",_this)}; +if (isNull _object) exitWith {TRACE_1("object null",_this)}; //Reset any variables on "real" respawn [_object, false] call FUNC(statusEffect_resetVariables); diff --git a/addons/common/functions/fnc_statusEffect_sendEffects.sqf b/addons/common/functions/fnc_statusEffect_sendEffects.sqf index 10f7ffb30c..a4e3f2d2a4 100644 --- a/addons/common/functions/fnc_statusEffect_sendEffects.sqf +++ b/addons/common/functions/fnc_statusEffect_sendEffects.sqf @@ -30,12 +30,21 @@ if (isNull _object) exitWith {}; TRACE_2("checking if event is nil",_x,_effectNumber); if (_effectNumber != -1) then { private _eventName = format [QGVAR(%1), _x]; - if (GVAR(statusEffect_isGlobal) select _forEachIndex) then { - TRACE_2("Sending Global Event", _object, _effectNumber); - [_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent; - } else { - TRACE_2("Sending Target Event", _object, _effectNumber); - [_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent; + switch (true) do { + case (GVAR(statusEffect_sendJIP) select _forEachIndex): { + TRACE_2("Sending Global JIP Event",_object,_effectNumber); + private _jipID = format [QGVAR(effect_%1_%2), _eventName, hashValue _object]; + [_eventName, [_object, _effectNumber], _jipID] call CBA_fnc_globalEventJIP; + [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; + }; + case (GVAR(statusEffect_isGlobal) select _forEachIndex): { + TRACE_2("Sending Global Event",_object,_effectNumber); + [_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent; + }; + default { + TRACE_2("Sending Target Event",_object,_effectNumber); + [_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent; + }; }; }; }; diff --git a/addons/common/functions/fnc_statusEffect_set.sqf b/addons/common/functions/fnc_statusEffect_set.sqf index 48af4bf771..a4bf352a56 100644 --- a/addons/common/functions/fnc_statusEffect_set.sqf +++ b/addons/common/functions/fnc_statusEffect_set.sqf @@ -23,7 +23,7 @@ TRACE_4("params",_object,_effectName,_ID,_set); //Only run this after the settings are initialized if !(GVAR(settingsInitFinished)) exitWith { - TRACE_1("pushing to runAtSettingsInitialized", _this); + TRACE_1("pushing to runAtSettingsInitialized",_this); GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_set), _this]; }; @@ -32,7 +32,7 @@ if (isNull _object) exitWith {TRACE_1("null",_object);}; [_object, true] call FUNC(statusEffect_resetVariables); //Check for mismatch, and set object ref //check ID case and set globally if not already set: -_ID = toLower _ID; +_ID = toLowerANSI _ID; private _statusReasons = missionNamespace getVariable [(format [QGVAR(statusEffects_%1), _effectName]), []]; private _statusIndex = _statusReasons find _ID; if (_statusIndex == -1) then { diff --git a/addons/common/functions/fnc_swayLoop.sqf b/addons/common/functions/fnc_swayLoop.sqf index 069d908d1a..adbc32053f 100644 --- a/addons/common/functions/fnc_swayLoop.sqf +++ b/addons/common/functions/fnc_swayLoop.sqf @@ -17,12 +17,12 @@ private _baseline = 1; if (GVAR(swayFactorsBaseline) isNotEqualTo []) then { - _baseline = 1 max ([missionNamespace, "ACE_setCustomAimCoef_baseline", "max"] call EFUNC(common,arithmeticGetResult)); + _baseline = 1 max ([missionNamespace, "ACE_setCustomAimCoef_baseline", "max"] call FUNC(arithmeticGetResult)); }; private _multiplier = 1; if (GVAR(swayFactorsMultiplier) isNotEqualTo []) then { - _multiplier = [missionNamespace, "ACE_setCustomAimCoef_multiplier", "product"] call EFUNC(common,arithmeticGetResult); + _multiplier = [missionNamespace, "ACE_setCustomAimCoef_multiplier", "product"] call FUNC(arithmeticGetResult); }; ACE_player setCustomAimCoef (_baseline * _multiplier); diff --git a/addons/common/functions/fnc_switchToGroupSide.sqf b/addons/common/functions/fnc_switchToGroupSide.sqf index 94d8c52701..1a3e588855 100644 --- a/addons/common/functions/fnc_switchToGroupSide.sqf +++ b/addons/common/functions/fnc_switchToGroupSide.sqf @@ -58,7 +58,7 @@ if (_switch) then { private _newGroup = createGroup (_x select 1); [_unit] joinSilent _newGroup; }; - if (count units _currentGroup == 0) then { + if (units _currentGroup isEqualTo []) then { deleteGroup _currentGroup; }; _previousGroupsList set [_forEachIndex, objNull]; diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 5bcb678524..75170fe7d1 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -20,7 +20,7 @@ params ["_name", "_args", ["_ttl", 0]]; if !(_name in GVAR(syncedEvents)) exitWith { - ERROR_1("Synced event key [%1] not found (syncedEvent).", _name); + ERROR_1("Synced event key [%1] not found (syncedEvent)",_name); false }; diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index 3c1ed2761b..e6b1fdbaf6 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -29,8 +29,7 @@ if (isNil QGVAR(publishSchedId)) then { { _x params ["_unit", "_varName"]; _unit setVariable [_varName, _unit getVariable _varName, true]; - false - } count GVAR(publishVarNames); + } forEach GVAR(publishVarNames); GVAR(publishVarNames) = []; GVAR(publishNextTime) = 1e7; diff --git a/addons/common/functions/fnc_uniqueItems.sqf b/addons/common/functions/fnc_uniqueItems.sqf index dc783ebbea..204501ca3f 100644 --- a/addons/common/functions/fnc_uniqueItems.sqf +++ b/addons/common/functions/fnc_uniqueItems.sqf @@ -1,37 +1,84 @@ #include "..\script_component.hpp" /* - * Author: mharis001 - * Returns list of unique items in a unit's inventory. - * Items are cached if unit is ACE_player. + * Author: mharis001, Blue, Brett Mayson + * Returns list of unique items in the target's inventory. * * Arguments: - * 0: Unit + * 0: Target + * 1: Include magazines + * 0: No (default) + * 1: Yes + * 2: Only magazines * * Return Value: * Items * * Example: - * [player] call ace_common_fnc_uniqueItems + * [player, 2] call ace_common_fnc_uniqueItems * * Public: No */ -params ["_unit"]; +params ["_target", ["_includeMagazines", 0]]; private _fnc_getItems = { - private _items = (getItemCargo uniformContainer _unit) select 0; - _items append ((getItemCargo vestContainer _unit) select 0); - _items append ((getItemCargo backpackContainer _unit) select 0); + private _items = []; + + private _inventoryItems = (getItemCargo uniformContainer _target) select 0; + _inventoryItems append ((getItemCargo vestContainer _target) select 0); + _inventoryItems append ((getItemCargo backpackContainer _target) select 0); + + _items set [0, _inventoryItems]; + _items set [1, magazines _target]; _items arrayIntersect _items }; -// Use cached items list if unit is ACE_player -if (_unit isEqualTo ACE_player) then { +// Cache items list if unit is ACE_player +if (_target isEqualTo ACE_player) then { if (isNil QGVAR(uniqueItemsCache)) then { GVAR(uniqueItemsCache) = call _fnc_getItems; }; - +GVAR(uniqueItemsCache) + + switch (_includeMagazines) do { + case 0: { + GVAR(uniqueItemsCache) select 0 + }; + case 1: { + (GVAR(uniqueItemsCache) select 1) + (GVAR(uniqueItemsCache) select 0) + }; + case 2: { + GVAR(uniqueItemsCache) select 1 + }; + }; } else { - call _fnc_getItems; + if (_target isKindOf "CAManBase") then { + private _items = call _fnc_getItems; + + switch (_includeMagazines) do { + case 0: { + _items select 0 + }; + case 1: { + (_items select 1) + (_items select 0) + }; + case 2: { + _items select 1 + }; + }; + } else { + private _items = switch (_includeMagazines) do { + case 0: { + itemCargo _target + }; + case 1: { + (magazineCargo _target) + (itemCargo _target) + }; + case 2: { + magazineCargo _target + }; + }; + + _items arrayIntersect _items + }; }; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index d7a2f57db0..0378c6a4b8 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -35,7 +35,7 @@ if (_emptyPos isEqualTo []) then { }; if (count _emptyPos != 3) exitwith { - WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle, getPosASL _vehicle, isTouchingGround _vehicle, speed _vehicle); + WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle); if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then { //display text saying there are no safe places to exit the vehicle [QGVAR(displayTextStructured), [localize LSTRING(NoRoomToUnload)], [_unloader]] call CBA_fnc_targetEvent; diff --git a/addons/common/initSettings.inc.sqf b/addons/common/initSettings.inc.sqf index 41fcdafecd..a784ac64a9 100644 --- a/addons/common/initSettings.inc.sqf +++ b/addons/common/initSettings.inc.sqf @@ -1,5 +1,6 @@ private _category = format ["ACE %1", LLSTRING(DisplayName)]; -private _categoryColors = [_category, format ["| %1 |", LLSTRING(subcategory_colors)]]; +private _categoryColors = [_category, LSTRING(subcategory_colors)]; +private _categorySway = [_category, LSTRING(subcategory_sway)]; [ QGVAR(checkPBOsAction), @@ -87,7 +88,7 @@ private _categoryColors = [_category, format ["| %1 |", LLSTRING(subcategory_col QGVAR(epilepsyFriendlyMode), "CHECKBOX", [LSTRING(EpilepsyFriendlyMode), LSTRING(EpilepsyFriendlyModeTooltip)], - format ["ACE %1", localize LSTRING(DisplayName)], + _category, false, 2 ] call CBA_fnc_addSetting; @@ -96,7 +97,45 @@ private _categoryColors = [_category, format ["| %1 |", LLSTRING(subcategory_col QGVAR(progressBarInfo), "LIST", [LSTRING(progressBarInfoName), LSTRING(progressBarInfoDesc)], - format ["ACE %1", localize LSTRING(DisplayName)], + _category, [[0, 1, 2], [LSTRING(None), LSTRING(progressBarInfoPercentage), LSTRING(progressBarInfoTime)], 2], 0 ] call CBA_fnc_addSetting; + +[ + QGVAR(enableSway), + "CHECKBOX", + [LSTRING(enableSway), LSTRING(enableSway_Description)], + _categorySway, + true, + 1, + {}, + true +] call CBA_fnc_addSetting; + +[ + QGVAR(swayFactor), + "SLIDER", + [LSTRING(SwayFactor), LSTRING(SwayFactor_Description)], + _categorySway, + [0, 5, 1, 2], + 1 +] call CBA_fnc_addSetting; + +[ + QGVAR(restedSwayFactor), + "SLIDER", + [LSTRING(RestedSwayFactor), LSTRING(RestedSwayFactor_Description)], + _categorySway, + [0, 5, 1, 2], + 1 +] call CBA_fnc_addSetting; + +[ + QGVAR(deployedSwayFactor), + "SLIDER", + [LSTRING(DeployedSwayFactor), LSTRING(DeployedSwayFactor_Description)], + _categorySway, + [0, 5, 1, 2], + 1 +] call CBA_fnc_addSetting; diff --git a/addons/common/scripts/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf index 0f2c055500..3ed51120b6 100644 --- a/addons/common/scripts/checkVersionNumber.sqf +++ b/addons/common/scripts/checkVersionNumber.sqf @@ -5,7 +5,7 @@ private _aceWhitelist = missionNamespace getVariable ["ACE_Version_Whitelist", [ private _files = CBA_common_addons select { (_x select [0,3] != "a3_") && {_x select [0,4] != "ace_"} && - {!((toLower _x) in _aceWhitelist)} + {!((toLowerANSI _x) in _aceWhitelist)} }; private _versions = []; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index bfce2cd510..1c960e9173 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -498,7 +498,7 @@ 设定当玩家有错误的 PBO 时要如何处理。 Nastavuje jakou akci provést pokud hráč nemá správné PBO. Określa akcję, która ma być podjęta, jeśli gracz nie ma właściwych PBO. - プレイヤーが不正規のPBOを所持している場合の動作を決定します。 + プレイヤーが不正規のPBOを所持している場合の動作を定義します。 Define la accion a tomar si un jugador no tiene el PBO correcto Definisce l'azione che verrà presa se il giocatore non ha gli stessi PBO. Определяет, какое действие будет предпринято, если игрок не имеет корректные PBO. @@ -1582,7 +1582,7 @@ Controls extra information shown in progress bar. - プログレス バーへ表示される情報量を決定します。 + プログレス バーへ表示される情報量を制御します。 Définit quelles informations supplémentaires sont affichées dans la barre de progression. Устанавливает дополнительную информацию в индикаторе процесса. Kontrolliert zusätzliche Informationen beim Fortschrittsbalkens. @@ -1641,7 +1641,7 @@ Renommer Umbenennen Zmień nazwę - 改名 + 名前変更 Rinomina 이름 바꾸기 重新命名 @@ -1828,5 +1828,96 @@ 下方 Alt + + Weapon Sway + 手ぶれ + 무기 흔들림 + Oscillation de l'arme + Колебание оружия + + + Enable Weapon Sway + 手ぶれを有効化 + 무기 흔들림 추가 + Activer l'oscillation de l'arme + Включить колебание оружия + + + Enables weapon sway influenced by sway factors, such as stance, fatigue and medical condition.\nDisabling this setting will defer sway to vanilla or other mods. + 姿勢、疲労、負傷状態などの手ぶれ要因に影響を受ける武器照準の揺れを有効にします。\nこの設定を無効にすると、手ぶれの揺れはバニラまたは他のMODの処理に任されます。 + 흔들림 계수, 자세, 피로도, 건강 상태 등의 요인에 영향을 받는 무기 흔들림을 활성화합니다.\n이 설정을 비활성화하면 바닐라 또는 다른 모드의 흔들림으로 대체됩니다. + Active l'oscillation de l'arme influencé par les facteurs d'oscillation, tels que la position, la fatigue et l'état de santé.\nLa désactivation de ce paramètre reportera l'oscillation à vanilla ou à d'autres mods. + Активируйте колебание оружия в зависимости от таких факторов, как стойка, усталость и состояние здоровья.\nОтключение этого параметра приведет к переносу раскачивания на vanilla или другие моды. + + + Sway factor + Factor de balanceo de mira + Verwacklungsfaktor + 手ぶれ因数 + 抖动系数 + 抖動因素 + Facteur de tremblement + Fattore di Oscillazione + Czynnik kołysania + Фактор колебания прицела + Fator de Balanço de Mira + Faktor kývání + 손떨림 정도 + + + Influences the amount of weapon sway. Higher means more sway. + Afecta al la estabilidad de la mira. Más alto significa más balanceo + Beeinflusst, wie ruhig man eine Waffe halten kann. Ein höherer Wert bedeutet weniger Stabilisierung. + 武器の手ぶれの大きさに影響します。値が高いほど、手ぶれが強くなります。 + 影响手持武器的晃动程度,数值越高,抖动的越厉害。 + 影響手持武器晃動程度,數值越高抖動越厲害 + Influe sur l'amplitude du tremblement de l'arme. Une valeur plus élevée signifie plus de tremblement. + Influenza l'aumento di oscillazione dell'arma quando affaticato. Maggiore significa più oscillazione. + Wpływa na poziom kołysania broni. Większa ilość znaczy większe kołysanie. + Влияет на колебания прицела оружия. Чем выше - тем больше. + Influencia a quantidade de balanço da mira da arma. Quanto maior, mais balanço. + Ovlivňuje množství kývání zbraní. Vyšší znamená více kývání. + 손떨림의 정도를 정합니다. 높을 수록 많이 휘적입니다. + + + Rested sway factor + Facteur de balancement au repos + 휴식 시 손떨림 정도 + Fator de balanço de mira em repouso + Verwacklungsfaktor, wenn aufgelegt + Fattore di Oscillazione Appoggiato + 静止依託時の手ぶれ係数 + Коэффициент колебания прицела в состоянии покоя + + + Influences the amount of weapon sway while weapon is rested. + Influence le degré de balancement de l'arme au repos. + 무기가 아무런 행동도 하지 않는 동안 무기가 흔들리는 정도를 정합니다. + Influencia a quantidade de balanço de mira enquanto a arma está em repouso. + Beeinflusst, wie ruhig man die Waffe hält, während sie aufgelegt ist. + Determina la quantità di oscillazione dell'arma quando questa è appoggiata. + 静止し壁などに依託している時の武器の手ぶれの大きさに影響します。 + Влияет на величину колебания прицела оружия в состоянии покоя. + + + Deployed sway factor + Facteur de balancement déployé + 거치 시 손떨림 정도 + Fator de balanço de mira em posição de tiro + Verwacklungsfaktor, wenn Zweibein aufgestellt ist. + Fattore di Oscillazione su Bipode + 接地展開時の手ぶれ係数 + Коэффициент колебания прицела при развертывании + + + Influences the amount of weapon sway while weapon is deployed. + Influence le degré de balancement de l'arme déployée. + 무기를 거치하는 동안 무기를 흔드는 정도를 정합니다. + Influencia a quantidade de balanço de mira enquanto a arma está em posição de tiro. + Beeinflusst, wie ruhig man die Waffen hält, während das Zweibein aufgestellt ist. + Determina la quantità di oscillazione dell'arma quando questa è stabilizzata usando il bipode. + 武器の接地展開時の武器の手ぶれの大きさに影響します。 + Влияет на величину колебания прицела оружия при его развертывании. + diff --git a/addons/compat_cup_terrains/$PBOPREFIX$ b/addons/compat_cup_terrains/$PBOPREFIX$ new file mode 100644 index 0000000000..f904236cf3 --- /dev/null +++ b/addons/compat_cup_terrains/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup_terrains diff --git a/addons/compat_cup_terrains/CfgEventHandlers.hpp b/addons/compat_cup_terrains/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9cc1b0427b --- /dev/null +++ b/addons/compat_cup_terrains/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/compat_cup_terrains/CfgVehicles.hpp b/addons/compat_cup_terrains/CfgVehicles.hpp new file mode 100644 index 0000000000..08176b77fe --- /dev/null +++ b/addons/compat_cup_terrains/CfgVehicles.hpp @@ -0,0 +1,48 @@ +class CfgVehicles { + class House; + class House_Small_F; + class Strategic; + class House_EP1: House {}; + + class Land_Benzina_schnell: House { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-1.5,-3.93,-1.25}, {2.35,-3.93,-1.25}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + position = "[0,-3.93,-1.25]"; + distance = 5; + condition = "true"; + }; + }; + }; + class Land_A_FuelStation_Feed: Strategic { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class Land_Ind_FuelStation_Feed_EP1: House_EP1 { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class Land_FuelStation_Feed_PMC: Strategic { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + }; + class FuelStation: House_Small_F { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{1.25, .2, -1.1}}; + EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + position = "[1.25, .2, -1]"; + distance = 5; + condition = "true"; + }; + }; + }; +}; diff --git a/addons/compat_cup_terrains/XEH_postInit.sqf b/addons/compat_cup_terrains/XEH_postInit.sqf new file mode 100644 index 0000000000..32b9393d98 --- /dev/null +++ b/addons/compat_cup_terrains/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (["CUP_Terrains_ACE_compat"] call EFUNC(common,isModLoaded)) exitWith { + ERROR_WITH_TITLE("Duplicate CUP/ACE Compats","Compats are now part of ACE - Uninstall 'CUP ACE3 Compatibility Addon - Terrains'"); +}; diff --git a/addons/compat_cup_terrains/config.cpp b/addons/compat_cup_terrains/config.cpp new file mode 100644 index 0000000000..a7020be4da --- /dev/null +++ b/addons/compat_cup_terrains/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" +#include "\z\ace\addons\refuel\defines.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CABuildings", + "CAStructuresHouse_A_FuelStation", + "CAStructures_E_Ind_Ind_FuelStation", + "CAStructures_PMC_FuelStation", + "CUP_Buildings_Config", + "ace_refuel" // not a sub-component because it's all this compat does + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Community Upgrade Project", "Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgEventHandlers.hpp" diff --git a/addons/compat_cup_terrains/script_component.hpp b/addons/compat_cup_terrains/script_component.hpp new file mode 100644 index 0000000000..633de5584b --- /dev/null +++ b/addons/compat_cup_terrains/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_cup_terrains +#define COMPONENT_BEAUTIFIED CUP Terrains Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/compat_cup_units/$PBOPREFIX$ b/addons/compat_cup_units/$PBOPREFIX$ new file mode 100644 index 0000000000..7a3dc51ddd --- /dev/null +++ b/addons/compat_cup_units/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup_units diff --git a/addons/compat_cup_units/CfgWeapons.hpp b/addons/compat_cup_units/CfgWeapons.hpp new file mode 100644 index 0000000000..37a210db9d --- /dev/null +++ b/addons/compat_cup_units/CfgWeapons.hpp @@ -0,0 +1,87 @@ +#define HEARING(CLASSNAME) \ + class CLASSNAME: ItemCore { \ + ace_hearing_protection = 0.75; \ + ace_hearing_lowerVolume = 0; \ + } + +#define HEARING_PARENT(CLASSNAME,PARENT) \ + class CLASSNAME: PARENT { \ + ace_hearing_protection = 0.75; \ + ace_hearing_lowerVolume = 0; \ + } + +class CfgWeapons { + class ItemCore; + class CUP_H_PMC_Beanie_Khaki; + + HEARING(CUP_H_BAF_DDPM_Mk6_CREW_PRR); + HEARING(CUP_H_BAF_DPM_Mk6_CREW_PRR); + HEARING(CUP_H_BAF_MTP_Mk6_CREW_PRR); + HEARING(CUP_H_CZ_Cap_Headphones); + HEARING(CUP_H_CZ_Cap_Headphones_des); + HEARING(CUP_H_CZ_Helmet05); + HEARING(CUP_H_CZ_Helmet07); + HEARING(CUP_H_CZ_Helmet08); + HEARING(CUP_H_CZ_Helmet09); + HEARING(CUP_H_CZ_Helmet10); + HEARING(CUP_H_FR_ECH); + HEARING(CUP_H_Ger_Beret_TankCommander_Blk); + HEARING(CUP_H_Ger_Beret_TankCommander_Grn); + HEARING(CUP_H_Ger_Cap_EP_Grn1); + HEARING(CUP_H_Ger_Cap_EP_Grn2); + HEARING(CUP_H_Ger_Cap_EP_Tan1); + HEARING(CUP_H_Ger_Cap_EP_Tan2); + HEARING(CUP_H_OpsCore_Black); + HEARING(CUP_H_OpsCore_Black_SF); + HEARING(CUP_H_OpsCore_Covered_AAF); + HEARING(CUP_H_OpsCore_Covered_AAF_SF); + HEARING(CUP_H_OpsCore_Covered_Fleck); + HEARING(CUP_H_OpsCore_Covered_Fleck_SF); + HEARING(CUP_H_OpsCore_Covered_MCAM); + HEARING(CUP_H_OpsCore_Covered_MCAM_SF); + HEARING(CUP_H_OpsCore_Covered_MCAM_US); + HEARING(CUP_H_OpsCore_Covered_MCAM_US_SF); + HEARING(CUP_H_OpsCore_Covered_MTP); + HEARING(CUP_H_OpsCore_Covered_MTP_SF); + HEARING(CUP_H_OpsCore_Covered_Tigerstripe); + HEARING(CUP_H_OpsCore_Covered_Tigerstripe_SF); + HEARING(CUP_H_OpsCore_Covered_Tropen); + HEARING(CUP_H_OpsCore_Covered_Tropen_SF); + HEARING(CUP_H_OpsCore_Covered_UCP); + HEARING(CUP_H_OpsCore_Covered_UCP_SF); + HEARING(CUP_H_OpsCore_Green); + HEARING(CUP_H_OpsCore_Green_SF); + HEARING(CUP_H_OpsCore_Grey); + HEARING(CUP_H_OpsCore_Grey_SF); + HEARING(CUP_H_OpsCore_Spray); + HEARING(CUP_H_OpsCore_Spray_SF); + HEARING(CUP_H_OpsCore_Spray_US); + HEARING(CUP_H_OpsCore_Spray_US_SF); + HEARING(CUP_H_OpsCore_Tan); + HEARING(CUP_H_OpsCore_Tan_SF); + HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Khaki,CUP_H_PMC_Beanie_Khaki); + HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Black,CUP_H_PMC_Beanie_Headphones_Khaki); + HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Winter,CUP_H_PMC_Beanie_Headphones_Khaki); + HEARING(CUP_H_PMC_Cap_Back_EP_Grey); + HEARING(CUP_H_PMC_Cap_Back_EP_Tan); + HEARING(CUP_H_PMC_Cap_EP_Grey); + HEARING(CUP_H_PMC_Cap_EP_Tan); + HEARING(CUP_H_PMC_EP_Headset); + HEARING(CUP_H_USArmy_HelmetMICH_earpro); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_DCU); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess_DCU); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess_wdl); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_wdl); + HEARING(CUP_H_USArmy_Helmet_ECH1_Black); + HEARING(CUP_H_USArmy_Helmet_ECH1_Green); + HEARING(CUP_H_USArmy_Helmet_ECH1_Sand); + HEARING(CUP_H_USArmy_Helmet_ECH2_Black); + HEARING(CUP_H_USArmy_Helmet_ECH2_GREEN); + HEARING(CUP_H_USArmy_Helmet_ECH2_Sand); + HEARING(CUP_H_USMC_Crew_Helmet); + HEARING(CUP_H_USMC_MICH2000_DEF_DES); + HEARING(CUP_H_USMC_MICH2000_DEF_ESS_DES); + HEARING(CUP_H_USMC_MICH2000_DEF_ESS_WDL); + HEARING(CUP_H_USMC_MICH2000_DEF_WDL); +}; diff --git a/addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp b/addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp new file mode 100644 index 0000000000..386cc7df0b --- /dev/null +++ b/addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp @@ -0,0 +1,86 @@ +class CfgVehicles { + class SoldierWB; + class Civilian_F; + + class CUP_BAF_Soldier_DPM_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_BAF_Soldier_DDPM_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_BAF_Soldier_MTP_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_GER_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_NAPA_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_PMC_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_PMC_Soldier_Winter_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_RUS_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_TK_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_TKI_Insurgent_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_TKG_Guerrilla_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_USMC_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_FR_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Civil_Chernarus_Base: Civilian_F { + modelSides[] = {6}; + }; + class CUP_Creatures_Civil_Takistan_Base: Civilian_F { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_ACR_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_CDF_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_UNO_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_OPFINS_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_RACS_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_SLA_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_USA_Soldier_ACU_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_USA_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_Reservist_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_Recon_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_Man_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_SF_Base: SoldierWB { + modelSides[] = {6}; + }; +}; diff --git a/addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp b/addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp new file mode 100644 index 0000000000..826f796226 --- /dev/null +++ b/addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Creatures_People_LoadOrder", + "ace_nouniformrestrictions" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike", "Jonpas"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_units/compat_cup_nouniformrestrictions/script_component.hpp b/addons/compat_cup_units/compat_cup_nouniformrestrictions/script_component.hpp new file mode 100644 index 0000000000..0b98185fa0 --- /dev/null +++ b/addons/compat_cup_units/compat_cup_nouniformrestrictions/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT nouniformrestrictions +#define SUBCOMPONENT_BEAUTIFIED No Uniform Restrictions +#include "..\script_component.hpp" diff --git a/addons/compat_cup_units/config.cpp b/addons/compat_cup_units/config.cpp new file mode 100644 index 0000000000..bde1052a11 --- /dev/null +++ b/addons/compat_cup_units/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"CUP_Creatures_People_LoadOrder"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike", "Jonpas"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_cup_units/script_component.hpp b/addons/compat_cup_units/script_component.hpp new file mode 100644 index 0000000000..46e1542b50 --- /dev/null +++ b/addons/compat_cup_units/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_cup_units +#define COMPONENT_BEAUTIFIED CUP Units Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/compat_cup_vehicles/$PBOPREFIX$ b/addons/compat_cup_vehicles/$PBOPREFIX$ new file mode 100644 index 0000000000..da4cebbc16 --- /dev/null +++ b/addons/compat_cup_vehicles/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup_vehicles diff --git a/addons/compat_cup_vehicles/CfgEventHandlers.hpp b/addons/compat_cup_vehicles/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f6503c2479 --- /dev/null +++ b/addons/compat_cup_vehicles/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/compat_cup_vehicles/CfgVehicles.hpp b/addons/compat_cup_vehicles/CfgVehicles.hpp new file mode 100644 index 0000000000..5334987fff --- /dev/null +++ b/addons/compat_cup_vehicles/CfgVehicles.hpp @@ -0,0 +1,288 @@ +class CfgVehicles { + class CUP_MTVR_Base; + class CUP_MTVR_Reammo_Base: CUP_MTVR_Base { + EGVAR(rearm,defaultSupply) = 1200; + }; + + class CUP_V3S_Open_Base; + class CUP_V3S_Rearm_Base: CUP_V3S_Open_Base { + EGVAR(rearm,defaultSupply) = 1200; + }; + + class CUP_Kamaz_5350_Base; + class CUP_Kamaz_5350_ReAmmo_Base: CUP_Kamaz_5350_Base { + EGVAR(rearm,defaultSupply) = 1200; + }; + + class CUP_T810_Unarmed_Base; + class CUP_T810_Reammo_Base: CUP_T810_Unarmed_Base { + EGVAR(rearm,defaultSupply) = 1200; + }; + + class Wheeled_APC_F; + class CUP_BTR80_Common_Base: Wheeled_APC_F { + class ace_viewports { + class view_0 { + camLocation[] = {0.734863, 0.143927, -0.291199}; + camAttach = 45; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_1 { + camLocation[] = {0.950684, -0.00122738, -0.344391}; + camAttach = 90; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_2 { + camLocation[] = {0.932129, -0.729811, -0.319}; + camAttach = 90; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_3 { + camLocation[] = {-0.963379, -0.749183, -0.351501}; + camAttach = -90; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_4 { + camLocation[] = {-0.973145, 0.0148516, -0.364868}; + camAttach = -90; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_5 { + camLocation[] = {-0.73584, 0.119176, -0.291229}; + camAttach = -45; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + }; + }; + class CUP_BTR90_Base: Wheeled_APC_F { + class ace_viewports { + class view_0 { + camLocation[] = {0.533417, 2.4613, -0.309951}; + camAttach = 0; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_1 { + camLocation[] = {0.877106, 2.38684, -0.306068}; + camAttach = 30; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_2 { + camLocation[] = {1.04312, 0.0909424, -0.281996}; + camAttach = 60; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_3 { + type = ""; + camLocation[] = {1.03799, -0.928223, -0.282196}; + camAttach = 80; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_4 { + type = ""; + camLocation[] = {-0.90097, -0.913086, -0.282192}; + camAttach = -80; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + class view_5 { + type = ""; + camLocation[] = {-0.939301, 0.109985, -0.281992}; + camAttach = -60; + compartments[]={"Compartment1"}; + roles[]={"cargo"}; + }; + }; + }; + class CUP_BTR90_HQ_Base: CUP_BTR90_Base { delete ace_viewports; }; // no cargo seats + + class Tank_F; + class CUP_M2Bradley_Base: Tank_F { + ace_hunterkiller = 1; + class ace_viewports { + class view_0 { + camLocation[] = {0.987915, -0.324707, -0.0673385}; + camAttach = 70; + roles[]={"cargo"}; + }; + class view_1 { + camLocation[] = {0.90979, -0.970215, -0.043139}; + camAttach = 120; + roles[]={"cargo"}; + }; + class view_2 { + camLocation[] = {0.328003, -1.87402, -0.0408039}; + camAttach = 160; + roles[]={"cargo"}; + }; + class view_3 { + camLocation[] = {-0.357178, -1.89063, -0.0480237}; + camAttach = 175; + roles[]={"cargo"}; + }; + class view_4 { + camLocation[] = {-0.752075, -1.87061, -0.0522318}; + camAttach = 190; + roles[]={"cargo"}; + }; + class view_5 { + camLocation[] = {-0.936401, -0.0942383, -0.107764}; + camAttach = -75; + roles[]={"cargo"}; + }; + class SLD { // suppose to only be only on A3, but the A2s have the screen on the model? + screenLocation[] = {0.729126,-0.191597,-0.573349}; + maxDistance = 5; + type = "screen"; + camLocation[] = {0,0,0.05}; + camAttach[] = {0,0}; + roles[]={"cargo"}; + }; + }; + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l1", "hitera_l2", "hitera_l3", "hitera_l4", "hitera_l5", + "hitera_l6", "hitera_l7", "hitera_l8", "hitera_r1", "hitera_r2", + "hitera_r3", "hitera_r4", "hitera_r5", "hitera_r6", "hitera_r7", + "hitera_r8", "hitera_t1", "hitera_t2", "hitera_t3", "hitera_t4", + "hitera_t5", "hitera_t6", "hitera_t7", "hitera_t8", "hitera_fr1", + "hitera_fr2", "hitera_fr3", "hitera_fr4", "hitera_fr5", "hitera_fr6", + "hitera_fr7", "hitera_fr8", "hitera_fr9", "hitera_fl1", "hitera_fl2", + "hitera_fl3", "hitera_fl4", "hitera_fl5" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = {}; + }; + class CUP_T90_Base: Tank_F { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l1", "hitera_l2", "hitera_l3", "hitera_r1", "hitera_r2", + "hitera_r3", "hitera_1_t_l", "hitera_1_t_r", "hitera_2_t_l", + "hitera_2_t_r" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = {}; + }; + class CUP_T90M_Base: Tank_F { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_t1", "hitera_t2", "hitera_t3", "hitera_t4", "hitera_t5", + "hitera_t6", "hitera_t7", "hitera_t8", "hitera_t9", "hitera_t10", + "hitera_t11", "hitera_t12", "hitera_t13", "hitera_t14", "hitera_t15", + "hitera_t16", "hitera_t17", "hitera_t18", "hitera_t19", "hitera_t20", + "hitera_t21", "hitera_f1", "hitera_f2", "hitera_f3", "hitera_f4", + "hitera_f5", "hitera_f6", "hitera_f7", "hitera_s1", "hitera_s2", + "hitera_s3", "hitera_s4", "hitera_s5", "hitera_s6", "hitera_s7", + "hitera_s8", "hitera_s9", "hitera_s10", "hitera_s11", "hitera_s12", + "hitera_t22", "hitera_t23", "hitera_t24", "hitera_t25", "hitera_t26", + "hitera_t27", "hitera_t28", "hitera_t29", "hitera_t30", "hitera_t31", + "hitera_t32", "hitera_t33" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "hitslat_left", "hitslat_right", "hitslat_turret_rear", + "hitslat_turret_left", "hitslat_rear" + }; + }; + + class CUP_T72_ACR_Base; + class CUP_B_T72_CZ: CUP_T72_ACR_Base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_top_l1", "hitera_top_l2", "hitera_top_l3", "hitera_top_l4", + "hitera_top_r1", "hitera_top_r2", "hitera_top_r3", "hitera_top_r4", + "hitera_front_r1", "hitera_front_r2", "hitera_front_l1", + "hitera_front_l2", "hitera_top_rear" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = {}; + }; + + class CUP_Leopard2_Base; + class CUP_Leopard2_ERA_Base: CUP_Leopard2_Base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_1", "hitera_2", "hitera_3", "hitera_4", "hitera_5", "hitera_6", + "hitera_7", "hitera_8", "hitera_9", "hitera_10", "hitera_11", "hitera_12", + "hitera_13", "hitera_14", "hitera_15", "hitera_16", "hitera_17", "hitera_18", + "hitera_19", "hitera_20", "hitera_21", "hitera_22", "hitera_23", "hitera_24", + "hitera_25", "hitera_26", "hitera_27", "hitera_28", "hitera_29", "hitera_30", + "hitera_31", "hitera_32", "hitera_33", "hitera_34", "hitera_35", "hitera_36", + "hitera_37", "hitera_38", "hitera_39", "hitera_40", "hitera_41", "hitera_42", + "hitera_43", "hitera_44", "hitera_45", "hitera_46", "hitera_47" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = {}; + }; + + class CUP_M1_Abrams_base; + class CUP_M1A2_TUSK_base: CUP_M1_Abrams_base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l1", "hitera_l2", "hitera_l3", "hitera_l4", "hitera_r1", + "hitera_r2", "hitera_r3", "hitera_r4" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "hitslat_rear" + }; + }; + + class CUP_M1Abrams_Base; + class CUP_M1Abrams_TUSK_Base: CUP_M1Abrams_Base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l01", "hitera_l02", "hitera_l03", "hitera_l04", "hitera_l05", + "hitera_l06", "hitera_l07", "hitera_l08", "hitera_l09", "hitera_l10", + "hitera_l11", "hitera_l12", "hitera_l13", "hitera_l14", "hitera_l15", + "hitera_l16", "hitera_r01", "hitera_r02", "hitera_r03", "hitera_r04", + "hitera_r05", "hitera_r06", "hitera_r07", "hitera_r08", "hitera_r09", + "hitera_r10", "hitera_r11", "hitera_r12", "hitera_r13", "hitera_r14", + "hitera_r15", "hitera_r16" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "hitslat_rear" + }; + }; + + class CUP_M1Abrams_A2_Base; + class CUP_M1Abrams_A2_TUSK_Base: CUP_M1Abrams_A2_Base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l01", "hitera_l02", "hitera_l03", "hitera_l04", "hitera_l05", + "hitera_l06", "hitera_l07", "hitera_l08", "hitera_l09", "hitera_l10", + "hitera_l11", "hitera_l12", "hitera_l13", "hitera_l14", "hitera_l15", + "hitera_l16", "hitera_l17", "hitera_l18", "hitera_l19", "hitera_l20", + "hitera_r01", "hitera_r02", "hitera_r03", "hitera_r04", "hitera_r05", + "hitera_r06", "hitera_r07", "hitera_r08", "hitera_r09", "hitera_r10", + "hitera_r11", "hitera_r12", "hitera_r13", "hitera_r14", "hitera_r15", + "hitera_r16", "hitera_r17", "hitera_r18", "hitera_r19", "hitera_r20" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "hitslat_rear" + }; + }; + + class CUP_M1A2Abrams_Base; + class CUP_M1A2Abrams_TUSK_Base: CUP_M1A2Abrams_Base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l01", "hitera_l02", "hitera_l03", "hitera_l04", "hitera_l05", + "hitera_l06", "hitera_l07", "hitera_l08", "hitera_l09", "hitera_l10", + "hitera_l11", "hitera_l12", "hitera_l13", "hitera_l14", "hitera_l15", + "hitera_l16", "hitera_r01", "hitera_r02", "hitera_r03", "hitera_r04", + "hitera_r05", "hitera_r06", "hitera_r07", "hitera_r08", "hitera_r09", + "hitera_r10", "hitera_r11", "hitera_r12", "hitera_r13", "hitera_r14", + "hitera_r15", "hitera_r16" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "hitslat_rear" + }; + }; + class CUP_M1A2Abrams_TUSK_II_Base: CUP_M1A2Abrams_TUSK_Base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "hitera_l01", "hitera_l02", "hitera_l03", "hitera_l04", "hitera_l05", + "hitera_l06", "hitera_l07", "hitera_l08", "hitera_l09", "hitera_l10", + "hitera_l11", "hitera_l12", "hitera_l13", "hitera_l14", "hitera_l15", + "hitera_l16", "hitera_l17", "hitera_l18", "hitera_l19", "hitera_l20", + "hitera_r01", "hitera_r02", "hitera_r03", "hitera_r04", "hitera_r05", + "hitera_r06", "hitera_r07", "hitera_r08", "hitera_r09", "hitera_r10", + "hitera_r11", "hitera_r12", "hitera_r13", "hitera_r14", "hitera_r15", + "hitera_r16", "hitera_r17", "hitera_r18", "hitera_r19", "hitera_r20" + }; + }; +}; diff --git a/addons/compat_cup_vehicles/XEH_PREP.hpp b/addons/compat_cup_vehicles/XEH_PREP.hpp new file mode 100644 index 0000000000..20674eee81 --- /dev/null +++ b/addons/compat_cup_vehicles/XEH_PREP.hpp @@ -0,0 +1,4 @@ +PREP(onCutHC3); +PREP(onCutUH1Y); +PREP(onPrepareHC3); +PREP(onPrepareUH1Y); diff --git a/addons/compat_cup_vehicles/XEH_postInit.sqf b/addons/compat_cup_vehicles/XEH_postInit.sqf new file mode 100644 index 0000000000..09bda76106 --- /dev/null +++ b/addons/compat_cup_vehicles/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (["CUP_Vehicles_ACE_compat"] call EFUNC(common,isModLoaded)) exitWith { + ERROR_WITH_TITLE("Duplicate CUP/ACE Compats","Compats are now part of ACE - Uninstall 'CUP ACE3 Compatibility Addon - Vehicles'"); +}; diff --git a/addons/compat_cup_vehicles/XEH_preInit.sqf b/addons/compat_cup_vehicles/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/compat_cup_vehicles/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/compat_cup_vehicles/XEH_preStart.sqf b/addons/compat_cup_vehicles/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/compat_cup_vehicles/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/CfgVehicles.hpp new file mode 100644 index 0000000000..168fdcc8d2 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/CfgVehicles.hpp @@ -0,0 +1,143 @@ +class CfgVehicles { + class CUP_AH6_BASE; + class CUP_MH6_TRANSPORT: CUP_AH6_BASE { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + }; + class CUP_B_MH6M_OBS_USA: CUP_MH6_TRANSPORT { + EGVAR(fastroping,enabled) = 0; + }; + class CUP_B_MH6J_OBS_USA: CUP_MH6_TRANSPORT { + EGVAR(fastroping,enabled) = 0; + }; + + class Helicopter_Base_H; + class CUP_AW159_Unarmed_Base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 2; + EGVAR(fastroping,friesType) = "ACE_friesGantry"; + EGVAR(fastroping,friesAttachmentPoint)[] = {1.05, 1, 1.3}; + EGVAR(fastroping,onCut) = QEFUNC(fastroping,onCutCommon); + EGVAR(fastroping,onPrepare) = QEFUNC(fastroping,onPrepareCommon); + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + EQUIP_FRIES_ATTRIBUTE; + + class UserActions { + class CloseRdoor { + condition = QUOTE(this doorPhase 'CargoDoorR' > 0.5 && ((this getCargoIndex player) isEqualTo 0) && !(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])); + }; + }; + }; + + class CUP_CH47F_base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight", "ropeOriginMid"}; + }; + + class CUP_CH53E_base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + + class UserActions { + class RampClose { + condition = QUOTE(this animationPhase 'ramp_bottom' >= 0.56 && player == driver this && !(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])); + }; + }; + }; + + class CUP_Merlin_HC3_Base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginRight"}; + EGVAR(fastroping,onPrepare) = QEFUNC(compat_cup_vehicles,onPrepareHC3); + EGVAR(fastroping,onCut) = QEFUNC(compat_cup_vehicles,onCutHC3); + + class UserActions { + class CloseRdoor { + condition = QUOTE(this doorPhase 'dvere_p' > 0.5 && {(this getCargoIndex player) isEqualTo 0} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); + }; + class OutWinch { + condition = "false"; + }; + class InWinch { + condition = "false"; + }; + }; + }; + + class CUP_Ka60_Base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + }; + + class CUP_MH60S_Base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginRight"}; + + class UserActions { + class OpenDoors; + class CloseDoors: OpenDoors { + condition = QUOTE(this animationPhase 'doors' > 0.5 && driver this == player && alive (this) && !(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])); + }; + }; + }; + + class CUP_Mi8_base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft"}; + }; + + class CUP_Mi8_medevac_base: CUP_Mi8_base { + EGVAR(fastroping,enabled) = 0; + }; + + class CUP_Mi171Sh_Base: CUP_Mi8_base { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + }; + + class CUP_SA330_Base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + + class UserActions { + class CloseRdoor { + condition = QUOTE(alive this && {this doorPhase 'ofrp_puma_porte_droite' > 0.5} && {(this getCargoIndex player) isEqualTo 0} && {!(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])}); + }; + class CloseLdoor { + condition = QUOTE(alive this && {this doorPhase 'ofrp_puma_porte_gauche' > 0.5} && {(this getCargoIndex player) isEqualTo 1} && !(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])); + }; + }; + }; + + class CUP_UH1H_base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 2; + EGVAR(fastroping,friesType) = "ACE_friesAnchorBar"; + EGVAR(fastroping,friesAttachmentPoint)[] = {0, 1.45, -0.3}; + EGVAR(fastroping,onCut) = QEFUNC(fastroping,onCutCommon); + EGVAR(fastroping,onPrepare) = QEFUNC(fastroping,onPrepareCommon); + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + EQUIP_FRIES_ATTRIBUTE; + }; + + class CUP_B_UH1Y_Base; + class CUP_B_UH1Y_UNA_USMC: CUP_B_UH1Y_Base { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginLeft", "ropeOriginRight"}; + EGVAR(fastroping,onPrepare) = QEFUNC(compat_cup_vehicles,onPrepareUH1Y); + EGVAR(fastroping,onCut) = QEFUNC(compat_cup_vehicles,onCutUH1Y); + }; + class CUP_B_UH1Y_MEV_USMC: CUP_B_UH1Y_UNA_USMC { + EGVAR(fastroping,enabled) = 0; + }; + + class CUP_UH60_Base: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {"ropeOriginRight"}; + + class UserActions { + class OpenDoors; + class CloseDoors: OpenDoors { + condition = QUOTE(this animationPhase 'doors' > 0.5 && driver this == player && alive (this) && !(this getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)])); + }; + }; + }; +}; diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp new file mode 100644 index 0000000000..1abe0de6ea --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_fastroping" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Community Upgrade Project", "Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/script_component.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/script_component.hpp new file mode 100644 index 0000000000..a3a1b47a32 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_fastroping/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT fastroping +#define SUBCOMPONENT_BEAUTIFIED Fastroping +#include "..\script_component.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp new file mode 100644 index 0000000000..186690908c --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp @@ -0,0 +1,36 @@ +class CfgVehicles { + class CUP_T810_Unarmed_Base; + class CUP_T810_Refuel_Base: CUP_T810_Unarmed_Base { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-1.01, 0.21, -0.5},{1.08, 0.2, -0.5}}; + EGVAR(refuel,fuelCargo) = 10000; + }; + + class Truck_02_fuel_base_F; + class CUP_Kamaz_5350_Refuel_Base: Truck_02_fuel_base_F { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.02, -3.33, -1.05}}; + EGVAR(refuel,fuelCargo) = 10000; + }; + + class CUP_Ural_Support_Base; + class CUP_Ural_Refuel_Base: CUP_Ural_Support_Base { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.05, -3.65, -0.42}}; + EGVAR(refuel,fuelCargo) = 10000; + }; + + class CUP_V3S_Open_Base; + class CUP_V3S_Refuel_Base: CUP_V3S_Open_Base { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-0.35, -3.35, -0.4},{0.40, -3.35, -0.4}}; + EGVAR(refuel,fuelCargo) = 6500; + }; + + class CUP_MTVR_Base; + class CUP_MTVR_Refuel_Base: CUP_MTVR_Base { + transportFuel = 0; + EGVAR(refuel,hooks)[] = {{-1.09, -0.01, -0.5},{1, -0.01, -0.5}}; + EGVAR(refuel,fuelCargo) = 10000; + }; +}; diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/config.cpp b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/config.cpp new file mode 100644 index 0000000000..f77c9903b9 --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_refuel" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Community Upgrade Project", "Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/script_component.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/script_component.hpp new file mode 100644 index 0000000000..b58db9432d --- /dev/null +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT refuel +#define SUBCOMPONENT_BEAUTIFIED Refuel +#include "..\script_component.hpp" diff --git a/addons/compat_cup_vehicles/config.cpp b/addons/compat_cup_vehicles/config.cpp new file mode 100644 index 0000000000..513993ef57 --- /dev/null +++ b/addons/compat_cup_vehicles/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Vehicles_LoadOrder", + "ace_interaction" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Community Upgrade Project", "Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_vehicles/functions/fnc_onCutHC3.sqf b/addons/compat_cup_vehicles/functions/fnc_onCutHC3.sqf new file mode 100644 index 0000000000..8514dd2aed --- /dev/null +++ b/addons/compat_cup_vehicles/functions/fnc_onCutHC3.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: Unknown + * Function for retracting the hooks for CUP HC3 helos. + * + * Arguments: + * 0: Helicopter + * + * Return Value: + * Amount of time to wait before cutting ropes + * + * Example: + * [_vehicle] call ace_compat_cup_vehicles_fnc_onCutHC3 + * + * Public: No + */ + +params ["_vehicle"]; + +_vehicle setVariable ["ace_fastroping_doorsLocked", false, true]; + +_vehicle animateSource ["Winchsection", 0]; +_vehicle animateSource ["Winchsection2", 0]; +_vehicle animateDoor ["dvere_p", 1]; + +2 diff --git a/addons/compat_cup_vehicles/functions/fnc_onCutUH1Y.sqf b/addons/compat_cup_vehicles/functions/fnc_onCutUH1Y.sqf new file mode 100644 index 0000000000..82a3eaf8a9 --- /dev/null +++ b/addons/compat_cup_vehicles/functions/fnc_onCutUH1Y.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: Unknown + * Function for retracting the hooks for CUP UH-1Y helos. + * + * Arguments: + * 0: Helicopter + * + * Return Value: + * Amount of time to wait before cutting ropes + * + * Example: + * [_vehicle] call ace_compat_cup_vehicles_fnc_onCutUH1Y + * + * Public: No + */ +params ["_vehicle"]; + +_vehicle setVariable ["ace_fastroping_doorsLocked", false, true]; +_vehicle animateSource ["fries_extend", 0]; + +2 diff --git a/addons/compat_cup_vehicles/functions/fnc_onPrepareHC3.sqf b/addons/compat_cup_vehicles/functions/fnc_onPrepareHC3.sqf new file mode 100644 index 0000000000..aad828a3a0 --- /dev/null +++ b/addons/compat_cup_vehicles/functions/fnc_onPrepareHC3.sqf @@ -0,0 +1,26 @@ +#include "..\script_component.hpp" +/* + * Author: Unknown + * Function for opening doors and extending the hook for HC3 helos. + * + * Arguments: + * 0: Helicopter + * + * Return Value: + * Amount of time to wait before deploying ropes + * + * Example: + * [_vehicle] call ace_compat_cup_vehicles_fnc_onPrepareUH1Y + * + * Public: No + */ + +params ["_vehicle"]; + +_vehicle setVariable ["ace_fastroping_doorsLocked", true, true]; + +_vehicle animateSource ["Winchsection", 1]; +_vehicle animateSource ["Winchsection2", 1]; +_vehicle animateDoor ["dvere_p", 0]; + +2 diff --git a/addons/compat_cup_vehicles/functions/fnc_onPrepareUH1Y.sqf b/addons/compat_cup_vehicles/functions/fnc_onPrepareUH1Y.sqf new file mode 100644 index 0000000000..f17ea79613 --- /dev/null +++ b/addons/compat_cup_vehicles/functions/fnc_onPrepareUH1Y.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: Unknown + * Function for extending the hook for the CUP UH-1Y Helos. + * + * Arguments: + * 0: Helicopter + * + * Return Value: + * Amount of time to wait before deploying ropes + * + * Example: + * [_vehicle] call ace_compat_cup_vehicles_fnc_onPrepareUH1Y + * + * Public: No + */ + +params ["_vehicle"]; + +_vehicle setVariable ["ace_fastroping_doorsLocked", true, true]; +_vehicle animateSource ["fries_extend", 1]; + +2 diff --git a/addons/compat_cup_vehicles/script_component.hpp b/addons/compat_cup_vehicles/script_component.hpp new file mode 100644 index 0000000000..effb2d5534 --- /dev/null +++ b/addons/compat_cup_vehicles/script_component.hpp @@ -0,0 +1,20 @@ +#define COMPONENT compat_cup_vehicles +#define COMPONENT_BEAUTIFIED CUP Vehicles Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" + +// Fries Macro +#define EQUIP_FRIES_ATTRIBUTE \ + class Attributes { \ + class ace_fastroping_equipFRIES { \ + property = "ace_fastroping_equipFRIES"; \ + control = "Checkbox"; \ + displayName = ECSTRING(fastroping,Eden_equipFRIES); \ + tooltip = ECSTRING(fastroping,Eden_equipFRIES_Tooltip); \ + expression = "[_this] call ace_fastroping_fnc_equipFRIES"; \ + typeName = "BOOL"; \ + condition = "objectVehicle"; \ + defaultValue = 0; \ + }; \ + } diff --git a/addons/compat_cup_weapons/$PBOPREFIX$ b/addons/compat_cup_weapons/$PBOPREFIX$ new file mode 100644 index 0000000000..c5368b0a6d --- /dev/null +++ b/addons/compat_cup_weapons/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup_weapons diff --git a/addons/compat_cup_weapons/CfgEventHandlers.hpp b/addons/compat_cup_weapons/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9cc1b0427b --- /dev/null +++ b/addons/compat_cup_weapons/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/compat_cup_weapons/CfgMagazines.hpp b/addons/compat_cup_weapons/CfgMagazines.hpp new file mode 100644 index 0000000000..6fd6e2f1cc --- /dev/null +++ b/addons/compat_cup_weapons/CfgMagazines.hpp @@ -0,0 +1,37 @@ +class CfgMagazines { + class CA_LauncherMagazine; + class CUP_NLAW_M: CA_LauncherMagazine { + ammo = "ACE_NLAW"; + }; + + // legacy classes from ACE disposable launchers + class CUP_M136_M; + class ACE_PreloadedMissileDummy_CUP: CUP_M136_M { + scope = 1; + scopeArsenal = 0; + }; + class CUP_RPG18_M; + class ACE_PreloadedMissileDummy_RPG18_CUP: CUP_RPG18_M { + scope = 1; + scopeArsenal = 0; + }; + class CUP_M72A6_M; + class ACE_PreloadedMissileDummy_M72A6_CUP: CUP_M72A6_M { + scope = 1; + scopeArsenal = 0; + }; + class ACE_PreloadedMissileDummy_NLAW_CUP: CUP_NLAW_M { + scope = 1; + scopeArsenal = 0; + }; + class CUP_Stinger_M; + class ACE_PreloadedMissileDummy_Stinger_CUP: CUP_Stinger_M { + scope = 1; + scopeArsenal = 0; + }; + class CUP_Strela_2_M; + class ACE_PreloadedMissileDummy_Strela_2_CUP: CUP_Strela_2_M { + scope = 1; + scopeArsenal = 0; + }; +}; diff --git a/addons/compat_cup_weapons/CfgWeapons.hpp b/addons/compat_cup_weapons/CfgWeapons.hpp new file mode 100644 index 0000000000..e69c75dee5 --- /dev/null +++ b/addons/compat_cup_weapons/CfgWeapons.hpp @@ -0,0 +1,36 @@ +class CfgWeapons { + class Launcher_Base_F; + class CUP_launch_M47: Launcher_Base_F { + ace_overpressure_angle = 45; + ace_overpressure_range = 8; + ace_overpressure_damage = 0.5; + }; + + class CUP_launch_MAAWS: Launcher_Base_F { + ace_overpressure_angle = 60; + ace_overpressure_range = 15; + ace_overpressure_damage = 0.7; + }; + class CUP_launch_MAAWS_Scope: CUP_launch_MAAWS {}; + + class CUP_launch_RPG7V: Launcher_Base_F { + ace_overpressure_angle = 45; + ace_overpressure_range = 6; + ace_overpressure_damage = 0.5; + }; + + class CUP_launch_Mk153Mod0: Launcher_Base_F { + ace_overpressure_angle = 30; + ace_overpressure_range = 15; + ace_overpressure_damage = 0.7; + }; + class CUP_launch_Mk153Mod0_SMAWOptics: CUP_launch_Mk153Mod0 {}; + + class CUP_launch_NLAW_Loaded: Launcher_Base_F { + ace_overpressure_angle = 30; + ace_overpressure_range = 2; + ace_overpressure_damage = 0.5; + ace_nlaw_enabled = 1; + canLock = 1; + }; +}; diff --git a/addons/compat_cup_weapons/XEH_postInit.sqf b/addons/compat_cup_weapons/XEH_postInit.sqf new file mode 100644 index 0000000000..79d81fda26 --- /dev/null +++ b/addons/compat_cup_weapons/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (["CUP_Weapons_ACE_compat"] call EFUNC(common,isModLoaded)) exitWith { + ERROR_WITH_TITLE("Duplicate CUP/ACE Compats","Compats are now part of ACE - Uninstall 'CUP ACE3 Compatibility Addon - Weapons'"); +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgMagazineGroups.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgMagazineGroups.hpp new file mode 100644 index 0000000000..430a5272ae --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgMagazineGroups.hpp @@ -0,0 +1,56 @@ +class ace_csw_groups { + class CUP_compats_29Rnd_30mm_AGS30_M { + CUP_29Rnd_30mm_AGS30_M = 1; + }; + class CUP_compats_48Rnd_40mm_MK19_M { + CUP_48Rnd_40mm_MK19_M = 1; + }; + class CUP_AT13_M { + CUP_6Rnd_AT13_M = 1; + }; + class CUP_compats_TOW_M { + CUP_6Rnd_TOW_HMMWV_M = 1; + }; + class CUP_compats_TOW2_M { + CUP_6Rnd_TOW2_M = 1; + }; + class CUP_compats_PG9_M { + CUP_16Rnd_PG9_AT_M = 1; + }; + class CUP_compats_OG9_M { + CUP_16Rnd_OG9_HE_M = 1; + }; + class CUP_compats_105mm_he { + CUP_30Rnd_105mmHE_M119_M = 1; + }; + class CUP_compats_105mm_smoke { + CUP_30Rnd_105mmSMOKE_M119_M = 1; + }; + class CUP_compats_105mm_wp { + CUP_30Rnd_105mmWP_M119_M = 1; + }; + class CUP_compats_105mm_laser { + CUP_30Rnd_105mmLASER_M119_M = 1; + }; + class CUP_compats_105mm_illum { + CUP_30Rnd_105mmILLUM_M119_M = 1; + }; + class CUP_compats_122mm_he { + CUP_30Rnd_122mmHE_D30_M = 1; + }; + class CUP_compats_122mm_smoke { + CUP_30Rnd_122mmSMOKE_D30_M = 1; + }; + class CUP_compats_122mm_wp { + CUP_30Rnd_122mmHE_D30_M = 1; + }; + class CUP_compats_122mm_laser { + CUP_30Rnd_122mmLASER_D30_M = 1; + }; + class CUP_compats_122mm_illum { + CUP_30Rnd_122mmILLUM_D30_M = 1; + }; + class CUP_compats_122mm_at { + CUP_30Rnd_122mmAT_D30_M = 1; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgMagazines.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgMagazines.hpp new file mode 100644 index 0000000000..1a37f4d1c9 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgMagazines.hpp @@ -0,0 +1,111 @@ +class CfgMagazines { + class VehicleMagazine; + class CUP_29Rnd_30mm_AGS30_M: VehicleMagazine { + ace_isbelt = 1; + }; + + class CUP_compats_29Rnd_30mm_AGS30_M: CUP_29Rnd_30mm_AGS30_M { + scope = 2; + type = 256; + count = 29; + mass = 40; + displayName = SUBCSTRING(mag_AGS30_displayName); + model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; + picture = QPATHTOEF(csw,UI\ammoBox_50bmg_ca.paa); + }; + + class 200Rnd_40mm_G_belt; + class CUP_48Rnd_40mm_MK19_M: 200Rnd_40mm_G_belt { + ace_isbelt = 1; + }; + + class CUP_compats_48Rnd_40mm_MK19_M: CUP_29Rnd_30mm_AGS30_M { + scope = 2; + type = 256; + count = 48; + mass = 40; + displayname = SUBCSTRING(mag_MK19_displayName); + model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; + picture = QPATHTOEF(csw,UI\ammoBox_50bmg_ca.paa); + }; + + class CUP_6Rnd_TOW_HMMWV_M; + class CUP_compats_TOW_M: CUP_6Rnd_TOW_HMMWV_M { + scope = 2; + type = 256; + count = 1; + mass = 200; + displayname = SUBCSTRING(mag_TOW_displayName); + model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; + picture = "\A3\Weapons_F_beta\Launchers\titan\Data\UI\gear_titan_missile_at_ca.paa"; + }; + + class CUP_6Rnd_TOW2_M; + class CUP_compats_TOW2_M: CUP_6Rnd_TOW2_M { + scope = 2; + type = 256; + count = 1; + mass = 200; + displayname = SUBCSTRING(mag_TOW2_displayName); + model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; + picture = "\A3\Weapons_F_beta\Launchers\titan\Data\UI\gear_titan_missile_at_ca.paa"; + }; + + class CUP_16Rnd_PG9_AT_M; + class CUP_compats_PG9_M: CUP_16Rnd_PG9_AT_M { + displayName = SUBCSTRING(mag_PG9_displayName); + model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; + scope = 2; + type = 256; + count = 1; + mass = 80; + picture = "\A3\Weapons_F_Exp\Launchers\RPG7\Data\UI\icon_rocket_RPG7_ca.paa"; + }; + + class CUP_16Rnd_OG9_HE_M; + class CUP_compats_OG9_M: CUP_16Rnd_OG9_HE_M { + displayName = SUBCSTRING(mag_OG9_displayName); + model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; + scope = 2; + type = 256; + count = 1; + mass = 80; + picture = "\A3\Weapons_F_Exp\Launchers\RPG7\Data\UI\icon_rocket_RPG7_ca.paa"; + }; + + class ACE_1Rnd_82mm_Mo_HE; + class CUP_compats_105mm_he: ACE_1Rnd_82mm_Mo_HE { + displayName = SUBCSTRING(mag_M1HE_displayName); + mass = 120; + }; + class CUP_compats_105mm_smoke: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_M84Smoke_displayName); + }; + class CUP_compats_105mm_wp: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_M60A2_displayName); + }; + class CUP_compats_105mm_laser: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_M67AT_displayName); + }; + class CUP_compats_105mm_illum: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_M314Illum_displayName); + }; + class CUP_compats_122mm_he: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_3OF56_displayName); + }; + class CUP_compats_122mm_laser: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_3OF69M_displayName); + }; + class CUP_compats_122mm_wp: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_122mmWP_displayName); + }; + class CUP_compats_122mm_smoke: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_122mmSmoke_displayName); + }; + class CUP_compats_122mm_illum: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_122mmIllum_displayName); + }; + class CUP_compats_122mm_at: CUP_compats_105mm_he { + displayName = SUBCSTRING(mag_122mmAT_displayName); + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp new file mode 100644 index 0000000000..3924ae0386 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp @@ -0,0 +1,200 @@ +class CfgVehicles { + class LandVehicle; + class StaticWeapon: LandVehicle { + class ACE_Actions { + class ACE_MainActions; + }; + }; + + class StaticMortar: StaticWeapon {}; + class CUP_2b14_82mm_Base: StaticMortar { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = ""; + selection = ""; // no good selections for this mortar + }; + }; + class ace_csw { + enabled = 1; + magazineLocation = "_target selectionPosition 'otochlaven'"; + proxyWeapon = "CUP_proxy_mortar_82mm"; + disassembleWeapon = "CUP_2b14_carry"; + disassembleTurret = "ace_csw_mortarBaseplate"; + desiredAmmo = 1; + ammoLoadTime = 3; + ammoUnloadTime = 3; + }; + }; + + class CUP_M252_base: CUP_2b14_82mm_Base { + class ace_csw: ace_csw { + disassembleWeapon = "CUP_m252_carry"; + disassembleTurret = "ace_csw_mortarBaseplate"; + }; + }; + + class CUP_L16A2_base: CUP_M252_base { + class ace_csw: ace_csw { + disassembleWeapon = "CUP_l16a2_carry"; + disassembleTurret = "ace_csw_mortarBaseplate"; + }; + }; + + class StaticMGWeapon; + class CUP_M2StaticMG_base: StaticMGWeapon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_m2"; + magazineLocation = "_target selectionPosition 'magazine'"; + disassembleWeapon = "CUP_m2_carry"; + disassembleTurret = "ace_csw_m3Tripod"; + desiredAmmo = 100; + ammoLoadTime = 10; + ammoUnloadTime = 8; + }; + }; + + class CUP_M2StaticMG_MiniTripod_base: CUP_M2StaticMG_base { + class ace_csw: ace_csw { + enabled = 1; + disassembleTurret = "ace_csw_m3TripodLow"; + }; + }; + + class CUP_DSHKM_base: StaticMGWeapon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_DSHKM"; + magazineLocation = "_target selectionPosition 'magazine'"; + disassembleWeapon = "CUP_DSHKM_carry"; + disassembleTurret = "ace_csw_kordTripod"; + desiredAmmo = 100; + ammoLoadTime = 10; + ammoUnloadTime = 8; + }; + }; + + class CUP_DSHKM_MiniTripod_base: CUP_DSHKM_base { + class ace_csw: ace_csw { + enabled = 1; + disassembleTurret = "ace_csw_kordTripodLow"; + }; + }; + + class CUP_KORD_Base: StaticMGWeapon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_KORD"; + magazineLocation = "_target selectionPosition 'magazine'"; + disassembleWeapon = "CUP_KORD_carry"; + disassembleTurret = "ace_csw_kordTripod"; + desiredAmmo = 100; + ammoLoadTime = 10; + ammoUnloadTime = 8; + }; + }; + + class CUP_KORD_MiniTripod_Base: CUP_KORD_Base { + class ace_csw: ace_csw { + enabled = 1; + disassembleTurret = "ace_csw_kordTripodLow"; + }; + }; + + class StaticGrenadeLauncher; + class CUP_AGS_base: StaticGrenadeLauncher { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_AGS30"; + magazineLocation = "_target selectionPosition 'otochlaven'"; + disassembleWeapon = "CUP_AGS30_carry"; + disassembleTurret = "ace_csw_sag30Tripod"; + desiredAmmo = 29; + ammoLoadTime = 10; + ammoUnloadTime = 8; + }; + }; + + class CUP_MK19_TriPod_base: StaticGrenadeLauncher { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_MK19"; + magazineLocation = "_target selectionPosition 'magazine'"; + disassembleWeapon = "CUP_MK19_carry"; + disassembleTurret = "ace_csw_m3TripodLow"; + desiredAmmo = 48; + ammoLoadTime = 10; + ammoUnloadTime = 8; + }; + }; + + class StaticATWeapon; + class CUP_Metis_Base: StaticATWeapon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_AT13"; + magazineLocation = "_target selectionPosition 'gun'"; + disassembleWeapon = "CUP_launch_Metis"; + disassembleTurret = ""; + desiredAmmo = 1; + ammoLoadTime = 7; + ammoUnloadTime = 5; + }; + }; + + class CUP_TOW_TriPod_base: StaticATWeapon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_TOW"; + magazineLocation = "_target selectionPosition 'otochlaven'"; + disassembleWeapon = "CUP_TOW_carry"; + disassembleTurret = "ace_csw_m220Tripod"; + desiredAmmo = 1; + ammoLoadTime = 8; + ammoUnloadTime = 5; + }; + }; + + class CUP_TOW2_TriPod_base: CUP_TOW_TriPod_base { + class ace_csw: ace_csw { + disassembleWeapon = "CUP_TOW2_carry"; + }; + }; + + class CUP_SPG9_base: StaticATWeapon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_SPG9"; + magazineLocation = "_target selectionPosition 'otochlaven'"; + disassembleWeapon = "CUP_SPG9_carry"; + disassembleTurret = "ace_csw_spg9Tripod"; + desiredAmmo = 1; + ammoLoadTime = 5; + ammoUnloadTime = 3; + }; + }; + + class StaticCannon; + class CUP_D30_base: StaticCannon { + class ace_csw { + enabled = 1; + proxyWeapon = "CUP_proxy_D30"; + magazineLocation = "_target selectionPosition 'otochlaven'"; + desiredAmmo = 1; + ammoLoadTime = 5; + ammoUnloadTime = 5; + }; + }; + + class CUP_D30_AT_base: CUP_D30_base { + class ace_csw: ace_csw { + proxyWeapon = "CUP_proxy_D30AT"; + }; + }; + + class CUP_M119_base: CUP_D30_base { + class ace_csw: ace_csw { + proxyWeapon = "CUP_proxy_M119"; + }; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp new file mode 100644 index 0000000000..9ff8519ce1 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgWeapons.hpp @@ -0,0 +1,289 @@ +class CfgWeapons { + class Launcher; + class Launcher_Base_F: Launcher { + class WeaponSlotsInfo; + }; + + class CUP_2b14_carry: Launcher_Base_F { + displayName = ECSTRING(csw,2b14_tube); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\Podnos\data\ui\podnos_2b14_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 20; + pickupTime = 25; + class assembleTo { + ace_csw_mortarBaseplate = "CUP_I_2b14_82mm_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 670; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_m252_carry: CUP_2b14_carry { + displayName = ECSTRING(csw,m252_tube); + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\M252\data\ui\icomap_mortar_m251_ca.paa"; + class ace_csw: ace_csw { + class assembleTo { + ace_csw_mortarBaseplate = "CUP_I_M252_AAF"; + }; + }; + }; + + class CUP_l16a2_carry: CUP_2b14_carry { + displayName = ECSTRING(csw,m252_tube); + scope = 1; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\M252\data\ui\icomap_mortar_m251_ca.paa"; + class ace_csw: ace_csw { + class assembleTo { + ace_csw_mortarBaseplate = "CUP_I_L16A2_AAF"; + }; + }; + }; + + class CUP_m2_carry: Launcher_Base_F { + displayName = ECSTRING(csw,m2_gun); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\M2\data\ui\icomap_M2_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_m3Tripod = "CUP_I_M2StaticMG_AAF"; + ace_csw_m3TripodLow = "CUP_I_M2StaticMG_MiniTripod_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 840; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_DSHKM_carry: Launcher_Base_F { + displayName = ECSTRING(csw,dshk_gun); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\DShKM\data\ui\icomap_DShKM_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_kordTripod = "CUP_I_DSHKM_AAF"; + ace_csw_kordTripodLow = "CUP_I_DSHKM_MiniTriPod_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 740; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_KORD_carry: Launcher_Base_F { + displayName = ECSTRING(csw,kord_gun); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\KORD\data\ui\icomap_kord_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_kordTripod = "CUP_I_KORD_high_AAF"; + ace_csw_kordTripodLow = "CUP_I_KORD_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 550; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_AGS30_carry: Launcher_Base_F { + displayName = ECSTRING(csw,ags30_gun); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\AGS\data\ui\ags_static_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_sag30Tripod = "CUP_I_AGS_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 400; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_MK19_carry: Launcher_Base_F { + displayName = ECSTRING(csw,mk19_gun); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\Mk19\data\ui\icomap_mk19_stat_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_m3TripodLow = "CUP_I_MK19_TriPod_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 770; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_launch_Metis: Launcher_Base_F { + ace_overpressure_angle = 45; + ace_overpressure_range = 15; + ace_overpressure_damage = 0.7; + class ace_csw { + type = "mount"; + deployTime = 4; + pickupTime = 4; + deploy = "CUP_I_Metis_AAF"; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 300; + }; + }; + + class CUP_TOW_carry: Launcher_Base_F { + displayName = ECSTRING(csw,tow_tube); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\TOW\data\ui\icomap_tow_static_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_m220Tripod = "CUP_I_TOW_TriPod_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 500; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class CUP_TOW2_carry: CUP_TOW_carry { + class ace_csw: ace_csw { + class assembleTo { + ace_csw_m220Tripod = "CUP_I_TOW2_TriPod_AAF"; + }; + }; + }; + + class CUP_SPG9_carry: Launcher_Base_F { + displayName = ECSTRING(csw,spg9_tube); + scope = 2; + model = QPATHTOEF(apl,ACE_CSW_Bag.p3d); + modes[] = {}; + picture = "\CUP\Weapons\CUP_Weapons_StaticWeapons\SPG9\data\ui\icon_spg9_ca.paa"; + class ace_csw { + type = "weapon"; + deployTime = 4; + pickupTime = 4; + class assembleTo { + ace_csw_spg9Tripod = "CUP_I_SPG9_AAF"; + }; + }; + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 1000; + class MuzzleSlot { + iconScale = 0.1; + }; + }; + }; + + class mortar_82mm; + class CUP_proxy_mortar_82mm: mortar_82mm { + magazineReloadTime = 0.5; + }; + + class CUP_Vhmg_M2_static; + class CUP_proxy_m2: CUP_Vhmg_M2_static { + magazineReloadTime = 0.5; + }; + + class CUP_Vhmg_DSHKM_veh; + class CUP_proxy_DSHKM: CUP_Vhmg_DSHKM_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vhmg_KORD_veh; + class CUP_proxy_KORD: CUP_Vhmg_KORD_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vhmg_AGS30_veh; + class CUP_proxy_AGS30: CUP_Vhmg_AGS30_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vgmg_MK19_veh; + class CUP_proxy_MK19: CUP_Vgmg_MK19_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vmlauncher_AT13_single_veh; + class CUP_proxy_AT13: CUP_Vmlauncher_AT13_single_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vmlauncher_TOW_single_veh; + class CUP_proxy_TOW: CUP_Vmlauncher_TOW_single_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vacannon_SPG9_veh; + class CUP_proxy_SPG9: CUP_Vacannon_SPG9_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vcannon_M119_veh; + class CUP_proxy_M119: CUP_Vcannon_M119_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vcannon_D30_veh; + class CUP_proxy_D30: CUP_Vcannon_D30_veh { + magazineReloadTime = 0.5; + }; + + class CUP_Vcannon_D30AT_veh; + class CUP_proxy_D30AT: CUP_Vcannon_D30AT_veh { + magazineReloadTime = 0.5; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/config.cpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/config.cpp new file mode 100644 index 0000000000..ccc2f0baf2 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/config.cpp @@ -0,0 +1,26 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Weapons_loadOrder", + "ace_csw" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgMagazines.hpp" +#include "CfgMagazineGroups.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/script_component.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/script_component.hpp new file mode 100644 index 0000000000..77a1b484cb --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/script_component.hpp @@ -0,0 +1,5 @@ +#define SUBCOMPONENT csw +#define SUBCOMPONENT_BEAUTIFIED Crew-Served Weapons +#include "..\script_component.hpp" + +#include "\z\ace\addons\csw\script_config_macros_csw.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml new file mode 100644 index 0000000000..a23cf87af0 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml @@ -0,0 +1,118 @@ + + + + + [CSW] AGS30 Belt + [CSW] AGS30 ベルト + [CSW] Лента AGS 30 + [CSW] AGS-30 벨트 + + + [CSW] MK19 Belt + [CSW] Mk19 ベルト + [CSW] Лента Mk19 + [CSW] Mk.19 벨트 + + + [CSW] TOW Tube + [CSW] TOW チューブ + [CSW] Туба TOW + [CSW] TOW 튜브 + + + [CSW] TOW2 Tube + [CSW] TOW2 チューブ + [CSW] Туба TOW-2 + [CSW] TOW2 튜브 + + + [CSW] PG-9 Round + [CSW] PG-9 砲弾 + [CSW] Снаряд ПГ-9 + [CSW] PG-9 대전차고폭탄 + + + [CSW] OG-9 Round + [CSW] OG-9 砲弾 + [CSW] Снаряд OГ-9 + [CSW] OG-9 고폭파편탄 + + + [CSW] M1 HE + [CSW] M1 榴弾 + [CSW] M1 HE + [CSW] M1 고폭탄 + [CSW] M1 HE + + + [CSW] M84 Smoke + [CSW] M84 白煙弾 + [CSW] M84 Дымовая + [CSW] M84 연막탄 + [CSW] M84 Fumigène + + + [CSW] M60A2 WP + [CSW] M60A2 白リン弾 + [CSW] M60A2 WP + [CSW] M60A2 백린연막탄 + [CSW] M60A2 WP + + + [CSW] M67 AT Laser Guided + [CSW] M67 対戦車レーザー誘導弾 + [CSW] M67 AT Laser Guided + [CSW] M67 레이저유도 대전차탄 + [CSW] M67 AT Guidé laser + + + [CSW] M314 Illumination + [CSW] M314 照明弾 + [CSW] M314 Осветительная + [CSW] M314 조명탄 + [CSW] M314 Illumination + + + [CSW] 3OF56 HE + [CSW] 3OF56 榴弾 + [CSW] 3OF56 HE + [CSW] 3OF56 고폭탄 + [CSW] 3OF56 HE + + + [CSW] 3OF69M Laser Guided + [CSW] 3OF69M レーザー誘導弾 + [CSW] 3OF69M Laser Guided + [CSW] 3OF69M 레이저유도탄 + [CSW] 3OF69M Guidé laser + + + [CSW] 122mm WP + [CSW] 122mm 白リン弾 + [CSW] 122mm WP + [CSW] 122mm 백린탄 + [CSW] 122mm WP + + + [CSW] D-462 Smoke + [CSW] D-462 白煙弾 + [CSW] D-462 Дымовая + [CSW] D-462 연막탄 + [CSW] D-462 Fumigène + + + [CSW] S-463 Illumination + [CSW] S-463 照明弾 + [CSW] S-463 Осветительная + [CSW] S-463 조명탄 + [CSW] S-463 Eclairante + + + [CSW] BK-6M HEAT + [CSW] BK-6M HEAT弾 + [CSW] BK-6M HEAT + [CSW] BK-6M 대전차고폭탄 + [CSW] BK-6M HEAT + + + diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp new file mode 100644 index 0000000000..1658715ddb --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgAmmo.hpp @@ -0,0 +1,21 @@ +class CfgAmmo { + class PipeBombBase; + class CUP_TimeBomb_Ammo: PipeBombBase { + hit = 3000; + indirectHit = 3000; + indirectHitRange = 5; + ace_explosives_explodeOnDefuse = 0.02; + }; + class CUP_PipeBomb_Ammo: PipeBombBase { + hit = 3000; + indirectHit = 3000; + indirectHitRange = 5; + ace_explosives_explodeOnDefuse = 0.02; + }; + + class CUP_Mine_Ammo; + class CUP_IED_V1_Ammo: CUP_Mine_Ammo { + ace_explosives_explodeOnDefuse = 0.06; + triggerWhenDestroyed = 1; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp new file mode 100644 index 0000000000..15df2f7333 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgMagazines.hpp @@ -0,0 +1,103 @@ +class CfgMagazines { + class CA_Magazine; + class CUP_TimeBomb_M: CA_Magazine { + scope = 1; + ace_explosives_placeable = 1; + useAction = 0; + ace_explosives_setupObject = "ACE_PipeBomb_place_CUP"; + class ACE_Triggers { + SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone"}; + class Timer { + FuseTime = 0.5; + }; + class Command { + FuseTime = 0.5; + }; + }; + }; + class CUP_Mine_M: CUP_TimeBomb_M { + ace_explosives_placeable = 1; + useAction = 0; + ace_explosives_setupObject = "ACE_Mine_place_CUP"; + class ACE_Triggers { + SupportedTriggers[] = {"PressurePlate"}; + class PressurePlate { + digDistance = 0.08; + }; + }; + }; + class CUP_MineE_M: CUP_TimeBomb_M { + ace_explosives_placeable = 1; + useAction = 0; + ace_explosives_setupObject = "ACE_MineE_place_CUP"; + class ACE_Triggers { + SupportedTriggers[] = {"PressurePlate"}; + class PressurePlate { + digDistance = 0.06; + }; + }; + }; + + class CUP_IED_V1_M: CUP_Mine_M { + ace_explosives_placeable = 1; + useAction = 0; + ace_explosives_setupObject = "ACE_IED_V1_place_CUP"; + class ACE_Triggers { + SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; + }; + }; + class CUP_IED_V2_M: CUP_IED_V1_M { + useAction = 0; + ace_explosives_setupObject = "ACE_IED_V2_place_CUP"; + }; + class CUP_IED_V3_M: CUP_IED_V1_M { + useAction = 0; + ace_explosives_setupObject = "ACE_IED_V3_place_CUP"; + class ACE_Triggers { + SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; + class Timer { + digDistance = 0.06; + }; + class Command { + digDistance = 0.06; + }; + class MK16_Transmitter { + digDistance = 0.06; + }; + class DeadmanSwitch { + digDistance = 0.06; + }; + class Cellphone { + digDistance = 0.06; + }; + class PressurePlate { + digDistance = 0.06; + }; + }; + }; + class CUP_IED_V4_M: CUP_IED_V1_M { + useAction = 0; + ace_explosives_setupObject = "ACE_IED_V4_place_CUP"; + class ACE_Triggers { + SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch", "Cellphone", "PressurePlate"}; + class Timer { + digDistance = 0.08; + }; + class Command { + digDistance = 0.08; + }; + class MK16_Transmitter { + digDistance = 0.08; + }; + class DeadmanSwitch { + digDistance = 0.08; + }; + class Cellphone { + digDistance = 0.08; + }; + class PressurePlate { + digDistance = 0.08; + }; + }; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp new file mode 100644 index 0000000000..d10c315c3d --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp @@ -0,0 +1,32 @@ +class CfgVehicles { + class ACE_Explosives_Place; + class ACE_PipeBomb_place_CUP: ACE_Explosives_Place { + displayName = "Satchel Charge"; + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_Satchel.p3d"; + ace_explosives_offset[] = {0, 0, 0}; + }; + class ACE_Mine_place_CUP: ACE_Explosives_Place { + displayName = "AT-15 Anti-Tank Mine"; + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_AT15.p3d"; + ace_explosives_offset[] = {0, 0, 0}; + }; + class ACE_MineE_place_CUP: ACE_Explosives_Place { + displayName = "TM46 Anti-Tank Mine"; + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_TM46.p3d"; + ace_explosives_offset[] = {0, 0, 0}; + }; + class ACE_IED_V1_place_CUP: ACE_Explosives_Place { + displayName = "IED"; + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V1.p3d"; + ace_explosives_offset[] = {0, 0, 0}; + }; + class ACE_IED_V2_place_CUP: ACE_IED_V1_place_CUP { + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V2.p3d"; + }; + class ACE_IED_V3_place_CUP: ACE_IED_V1_place_CUP { + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V3.p3d"; + }; + class ACE_IED_V4_place_CUP: ACE_IED_V1_place_CUP { + model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V4.p3d"; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/config.cpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/config.cpp new file mode 100644 index 0000000000..ce16a310a8 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/config.cpp @@ -0,0 +1,25 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Weapons_LoadOrder", + "ace_explosives" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/script_component.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/script_component.hpp new file mode 100644 index 0000000000..a697aad7f3 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT explosives +#define SUBCOMPONENT_BEAUTIFIED Explosives +#include "..\script_component.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp new file mode 100644 index 0000000000..2632a43e61 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgAmmo.hpp @@ -0,0 +1,26 @@ +class CfgAmmo { + class MissileBase; + class CUP_M_Javelin_AT: MissileBase { + irLock = 1; + laserLock = 0; + airLock = 0; + + class ace_missileguidance { + enabled = 1; + minDeflection = 0.00005; + maxDeflection = 0.025; + incDeflection = 0.00005; + canVanillaLock = 0; + defaultSeekerType = "Optic"; + seekerTypes[] = {"Optic"}; + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + seekerAngle = 180; + seekerAccuracy = 1; + seekerMinRange = 0; + seekerMaxRange = 2500; + defaultAttackProfile = "JAV_TOP"; + attackProfiles[] = {"JAV_TOP", "JAV_DIR"}; + }; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgWeapons.hpp b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgWeapons.hpp new file mode 100644 index 0000000000..35b1d2bf09 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_javelin/CfgWeapons.hpp @@ -0,0 +1,14 @@ +class CfgWeapons { + class Launcher_Base_F; + class CUP_launch_Javelin: Launcher_Base_F { + ace_javelin_enabled = 1; + weaponInfoType = "ACE_RscOptics_javelin"; + modelOptics = QPATHTOEF(javelin,data\reticle_titan.p3d); + canLock = 0; + lockingTargetSound[] = {"", 0, 1}; + lockedTargetSound[] = {"", 0, 1}; + ace_overpressure_angle = 30; + ace_overpressure_range = 2; + ace_overpressure_damage = 0.5; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_javelin/config.cpp b/addons/compat_cup_weapons/compat_cup_weapons_javelin/config.cpp new file mode 100644 index 0000000000..8d5eeb37d5 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_javelin/config.cpp @@ -0,0 +1,24 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Weapons_LoadOrder", + "ace_javelin" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_javelin/script_component.hpp b/addons/compat_cup_weapons/compat_cup_weapons_javelin/script_component.hpp new file mode 100644 index 0000000000..d42e0f4f01 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_javelin/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT javelin +#define SUBCOMPONENT_BEAUTIFIED Javelin +#include "..\script_component.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp new file mode 100644 index 0000000000..04d26b8ead --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/CfgWeapons.hpp @@ -0,0 +1,118 @@ +#define NVG_BINO_PRESET \ + ace_nightvision_bluRadius = 0.13; \ + EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_binos_4096.paa); \ + EGVAR(nightvision,generation) = 3; \ + modelOptics = "" + +#define NVG_MONO_PRESET(GEN) \ + EGVAR(nightvision,eyeCups) = 1; \ + EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_4096.paa); \ + EGVAR(nightvision,bluRadius) = 0.13; \ + EGVAR(nightvision,generation) = GEN; \ + modelOptics = "" + +#define NVG_GPNVG_PRESET \ + EGVAR(nightvision,bluRadius) = 0.13; \ + EGVAR(nightvision,border) = QPATHTOEF(nightvision,data\nvg_mask_quad_4096.paa); \ + EGVAR(nightvision,generation) = 4; \ + modelOptics = "" + +#define NVG_GREEN_PRESET EGVAR(nightvision,colorPreset)[] = {0, {0.0, 0.0, 0.0, 0.0}, {1.3, 1.2, 0.0, 0.9}, {6, 1, 1, 0}} +#define NVG_WP_PRESET EGVAR(nightvision,colorPreset)[] = {0, {0.0, 0.0, 0.0, 0.0}, {1.1, 0.8, 1.9, 0.9}, {1, 1, 6, 0}} + +class CfgWeapons { + class NVGoggles; + // Monocular + class CUP_NVG_PVS7: NVGoggles { + NVG_MONO_PRESET(3); + NVG_GREEN_PRESET; + }; + class CUP_NVG_HMNVS: NVGoggles { + NVG_MONO_PRESET(3); + NVG_GREEN_PRESET; + }; + + // Binocular + class CUP_NVG_PVS14: NVGoggles { + NVG_BINO_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_PVS15_black: NVGoggles { + NVG_BINO_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_PVS15_green: NVGoggles { + NVG_BINO_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_PVS15_tan: NVGoggles { + NVG_BINO_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_PVS15_winter: NVGoggles { + NVG_BINO_PRESET; + NVG_GREEN_PRESET; + }; + + // White Phosphor NVGs + class CUP_NVG_PVS14_WP: CUP_NVG_PVS14 { + displayName = SUBCSTRING(CUP_NVG_PVS14_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_PVS15_black_WP: CUP_NVG_PVS15_black { + displayName = SUBCSTRING(CUP_NVG_PVS15_black_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_PVS15_green_WP: CUP_NVG_PVS15_green { + displayName = SUBCSTRING(CUP_NVG_PVS15_green_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_PVS15_tan_WP: CUP_NVG_PVS15_tan { + displayName = SUBCSTRING(CUP_NVG_PVS15_tan_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_PVS15_winter_WP: CUP_NVG_PVS15_winter { + displayName = SUBCSTRING(CUP_NVG_PVS15_winter_WP); + NVG_WP_PRESET; + }; + + // Gen4s + class CUP_NVG_1PN138: NVGoggles { + NVG_MONO_PRESET(4); + NVG_GREEN_PRESET; + }; + class CUP_NVG_GPNVG_black: NVGoggles { + NVG_GPNVG_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_GPNVG_tan: NVGoggles { + NVG_GPNVG_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_GPNVG_green: NVGoggles { + NVG_GPNVG_PRESET; + NVG_GREEN_PRESET; + }; + class CUP_NVG_GPNVG_winter: NVGoggles { + NVG_GPNVG_PRESET; + NVG_GREEN_PRESET; + }; + + // White Phosphor NVGs + class CUP_NVG_GPNVG_black_WP: CUP_NVG_GPNVG_black { + displayName = SUBCSTRING(CUP_NVG_GPNVG_black_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_GPNVG_tan_WP: CUP_NVG_GPNVG_tan { + displayName = SUBCSTRING(CUP_NVG_GPNVG_tan_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_GPNVG_green_WP: CUP_NVG_GPNVG_green { + displayName = SUBCSTRING(CUP_NVG_GPNVG_green_WP); + NVG_WP_PRESET; + }; + class CUP_NVG_GPNVG_winter_WP: CUP_NVG_GPNVG_winter { + displayName = SUBCSTRING(CUP_NVG_GPNVG_winter_WP); + NVG_WP_PRESET; + }; +}; diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/config.cpp b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/config.cpp new file mode 100644 index 0000000000..4730cdf3a9 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/config.cpp @@ -0,0 +1,26 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = { + "CUP_NVG_PVS14_WP", "CUP_NVG_PVS15_black_WP", "CUP_NVG_PVS15_green_WP", "CUP_NVG_PVS15_tan_WP", "CUP_NVG_PVS15_winter_WP", + "CUP_NVG_GPNVG_black_WP", "CUP_NVG_GPNVG_tan_WP", "CUP_NVG_GPNVG_green_WP", "CUP_NVG_GPNVG_winter_WP" + }; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Weapons_LoadOrder", + "ace_nightvision" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/script_component.hpp b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/script_component.hpp new file mode 100644 index 0000000000..85036e02b6 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT nightvision +#define SUBCOMPONENT_BEAUTIFIED Night Vision +#include "..\script_component.hpp" diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml new file mode 100644 index 0000000000..a52bea0e31 --- /dev/null +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml @@ -0,0 +1,89 @@ + + + + + AN/PVS-14 (WP) + AN/PVS-14 (白色蛍光) + AN/PVS-14 (FB) + AN/PVS-14 (WP) + AN/PVS-14 (WP) + AN/PVS-14 (백색광) + AN/PVS-14 (WP) + AN/PVS-14 (БФ) + + + AN/PVS-15 (Black, WP) + AN/PVS-15 (グリーン, 白色蛍光) + AN/PVS-15 (Verde, FB) + AN/PVS-15 (Zielone, WP) + AN/PVS-15 (grün, WP) + AN/PVS-15 (녹색, 백색광) + AN/PVS-15 (vertes, WP) + AN/PVS-15 (Чёрный, БФ) + + + AN/PVS-15 (Green, WP) + AN/PVS-15 (ブラック、白色蛍光) + AN/PVS-15 (Nero, FB) + AN/PVS-15 (Czarne, WP) + AN/PVS-15 (Schwarz, WP) + AN/PVS-15 (검정, 백색광) + AN/PVS-15 (noires, WP) + AN/PVS-15 (Зелёный, БФ) + + + AN/PVS-15 (Tan, WP) + AN/PVS-15 (タン, 白色蛍光) + AN/PVS-15 (Marroncina, FB) + AN/PVS-15 (jasnobrązowa, WP) + AN/PVS-15 (hellbraun, WP) + AN/PVS-15 (황갈색, 백색광) + AN/PVS-15 (marron clair, WP) + AN/PVS-15 (Желтовато-коричневый, БФ) + + + AN/PVS-15 (Winter, WP) + AN/PVS-15 (冬季迷彩, WP) + AN/PVS-15 (설상, 백색광) + AN/PVS-15 (Белый, БФ) + AN/PVS-15 (Blanc, WP) + + + GPNVG (Black, WP) + GPNVG (グリーン, 白色蛍光) + GPNVG (Verde, FB) + GPNVG (Zielone, WP) + GPNVG (grün, WP) + GPNVG (녹색, 백색광) + GPNVG (vertes, WP) + GPNVG (Чёрный, БФ) + + + GPNVG (Tan, WP) + GPNVG (タン, 白色蛍光) + GPNVG (Marroncina, FB) + GPNVG (jasnobrązowa, WP) + GPNVG (hellbraun, WP) + GPNVG (황갈색, 백색광) + GPNVG (marron clair, WP) + GPNVG (Желтовато-коричневый, БФ) + + + GPNVG (Green, WP) + GPNVG (ブラック、白色蛍光) + GPNVG (Nero, FB) + GPNVG (Czarne, WP) + GPNVG (Schwarz, WP) + GPNVG (검정, 백색광) + GPNVG (noires, WP) + GPNVG (Зелёный, БФ) + + + GPNVG (Winter, WP) + GPNVG (冬季迷彩, WP) + GPNVG (설상, 백색광) + AN/PVS-15 (Белый, БФ) + GPNVG (Blanc, WP) + + + diff --git a/addons/compat_cup_weapons/config.cpp b/addons/compat_cup_weapons/config.cpp new file mode 100644 index 0000000000..54dd0271cc --- /dev/null +++ b/addons/compat_cup_weapons/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"CUP_Weapons_LoadOrder"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Community Upgrade Project", "Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/compat_cup_weapons/script_component.hpp b/addons/compat_cup_weapons/script_component.hpp new file mode 100644 index 0000000000..9fb9892c1d --- /dev/null +++ b/addons/compat_cup_weapons/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_cup_weapons +#define COMPONENT_BEAUTIFIED CUP Weapons Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/compat_rhs_afrf3/CfgVehicles.hpp b/addons/compat_rhs_afrf3/CfgVehicles.hpp index 622d764ad2..1cf5029bc3 100644 --- a/addons/compat_rhs_afrf3/CfgVehicles.hpp +++ b/addons/compat_rhs_afrf3/CfgVehicles.hpp @@ -434,7 +434,11 @@ class CfgVehicles { "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", - "era_31_hitpoint", "era_32_hitpoint" + "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint", "era_35_hitpoint", "era_36_hitpoint", + "era_37_hitpoint", "era_38_hitpoint", "era_39_hitpoint", "era_40_hitpoint", "era_41_hitpoint", "era_42_hitpoint", + "era_43_hitpoint", "era_44_hitpoint", "era_45_hitpoint", "era_46_hitpoint", "era_47_hitpoint", "era_48_hitpoint", + "era_49_hitpoint", "era_50_hitpoint", "era_58_hitpoint", "era_59_hitpoint", "era_60_hitpoint", "era_61_hitpoint", + "era_62_hitpoint", "era_63_hitpoint", "era_64_hitpoint", "era_65_hitpoint", "era_66_hitpoint", "era_67_hitpoint" }; EGVAR(vehicle_damage,slatHitpoints)[] = { "SLAT_51_hitpoint", "SLAT_52_hitpoint", "SLAT_53_hitpoint", @@ -470,6 +474,9 @@ class CfgVehicles { "era_43_hitpoint", "era_44_hitpoint", "era_45_hitpoint", "era_46_hitpoint", "era_47_hitpoint", "era_48_hitpoint", "era_49_hitpoint", "era_50_hitpoint" }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "slat_51_hitpoint", "slat_52_hitpoint", "slat_53_hitpoint", "slat_54_hitpoint" + }; }; class rhs_t90am_tv: rhs_t90_tv { EGVAR(vehicle_damage,eraHitpoints)[] = { @@ -483,7 +490,7 @@ class CfgVehicles { "era_43_hitpoint", "era_44_hitpoint", "era_45_hitpoint", "era_46_hitpoint", "era_47_hitpoint", "era_48_hitpoint", "era_49_hitpoint", "era_50_hitpoint", "era_51_hitpoint", "era_52_hitpoint", "era_53_hitpoint", "era_54_hitpoint", "era_55_hitpoint", "era_56_hitpoint", "era_57_hitpoint", "era_58_hitpoint", "era_59_hitpoint", "era_60_hitpoint", - "era_51_hitpoint", "era_62_hitpoint", "era_63_hitpoint", "era_64_hitpoint", "era_65_hitpoint", "era_66_hitpoint" + "era_61_hitpoint", "era_62_hitpoint", "era_63_hitpoint", "era_64_hitpoint", "era_65_hitpoint", "era_66_hitpoint" }; EGVAR(vehicle_damage,slatHitpoints)[] = { "SLAT_18_hitpoint", "SLAT_19_hitpoint", "SLAT_20_hitpoint", "SLAT_21_hitpoint", @@ -492,10 +499,31 @@ class CfgVehicles { }; }; class rhs_t90sm_tv: rhs_t90am_tv { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "era_1_hitpoint", "era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", + "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", + "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", + "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", + "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", + "era_21_hitpoint", "era_22_hitpoint", "era_24_hitpoint", "era_25_hitpoint", + "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", + "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint", + "era_35_hitpoint", "era_36_hitpoint", "era_37_hitpoint", "era_38_hitpoint", + "era_39_hitpoint", "era_40_hitpoint", "era_41_hitpoint", "era_42_hitpoint", + "era_43_hitpoint", "era_44_hitpoint", "era_45_hitpoint", "era_46_hitpoint", + "era_47_hitpoint", "era_48_hitpoint", "era_49_hitpoint", "era_50_hitpoint", + "era_26_hitpoint", "era_55_hitpoint", "era_56_hitpoint", "era_57_hitpoint", + "era_58_hitpoint", "era_59_hitpoint", "era_60_hitpoint", "era_61_hitpoint", + "era_62_hitpoint", "era_63_hitpoint", "era_64_hitpoint", "era_65_hitpoint", + "era_66_hitpoint", "era_23_hitpoint" + }; EGVAR(vehicle_damage,slatHitpoints)[] = { - "SLAT_23_hitpoint", "SLAT_26_hitpoint", "SLAT_51_hitpoint", "SLAT_52_hitpoint", - "SLAT_53_hitpoint", "SLAT_54_hitpoint", "SLAT_55_hitpoint", "SLAT_56_hitpoint", - "SLAT_57_hitpoint" + "slat_23_hitpoint", "slat_26_hitpoint", "slat_51_hitpoint", + "slat_52_hitpoint", "slat_53_hitpoint", "slat_54_hitpoint", + "slat_55_hitpoint", "slat_56_hitpoint", "slat_57_hitpoint", + "slat_18_hitpoint", "slat_19_hitpoint", "slat_20_hitpoint", + "slat_21_hitpoint", "slat_22_hitpoint", "slat_24_hitpoint", + "slat_25_hitpoint" }; }; @@ -539,6 +567,35 @@ class CfgVehicles { "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint", "era_35_hitpoint", "era_36_hitpoint" }; }; + class rhs_t80um: rhs_t80u { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "era_1_hitpoint", "era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", + "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", + "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", + "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", + "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", + "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint", "era_35_hitpoint", "era_36_hitpoint" + }; + }; + + class rhs_t15_base; + class rhs_t15_tv: rhs_t15_base { + EGVAR(vehicle_damage,eraHitpoints)[] = { + "era_1_hitpoint", "era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", + "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", + "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", + "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", + "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", + "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", + "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", + "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint", "era_32_hitpoint", + "era_33_hitpoint", "era_34_hitpoint", "era_35_hitpoint", "era_36_hitpoint", + "era_37_hitpoint" + }; + EGVAR(vehicle_damage,slatHitpoints)[] = { + "slat_38_hitpoint", "slat_39_hitpoint", "slat_40_hitpoint", "slat_41_hitpoint" + }; + }; // Wirecutter Backpacks class rhs_assault_umbts; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp index 994af4f667..4fda436d18 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/CfgWeapons.hpp @@ -1,7 +1,14 @@ class CfgWeapons { // Last update: RHSAFRF 0.5.6 - class rhs_acc_perst3; - class rhs_acc_perst3_2dp: rhs_acc_perst3 { - baseWeapon = "rhs_acc_perst3_2dp"; + class rhs_acc_perst3_2dp_light; + class rhs_acc_perst3_2dp_light_h: rhs_acc_perst3_2dp_light { + baseWeapon = "rhs_acc_perst3_2dp_h"; + }; + + class acc_pointer_IR; + class rhs_acc_perst1ik: acc_pointer_IR { + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; }; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp index bb2e1bf3a2..b544accac3 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_arsenal/config.cpp @@ -15,4 +15,4 @@ class CfgPatches { }; }; -//#include "CfgWeapons.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp index fd889cd096..6a3bb0a083 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_csw/CfgVehicles.hpp @@ -5,7 +5,6 @@ class CfgVehicles { class StaticGrenadeLauncher; class rhs_SPG9_base: AT_01_base_F { - // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_SPG9); @@ -26,7 +25,6 @@ class CfgVehicles { }; class rhs_Kornet_Base: AT_01_base_F { - // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K133_launcher); @@ -40,7 +38,6 @@ class CfgVehicles { }; class rhs_Metis_Base: AT_01_base_F { - // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_9K115_2_launcher); @@ -54,7 +51,6 @@ class CfgVehicles { }; class rhs_2b14_82mm_Base: StaticMortar { - // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; magazineLocation = ""; @@ -99,7 +95,6 @@ class CfgVehicles { }; class RHS_AGS30_TriPod_base: StaticGrenadeLauncher { - // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_AGS30); diff --git a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp index 220aec4c24..7e58387dab 100644 --- a/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp +++ b/addons/compat_rhs_gref3/compat_rhs_gref3_csw/CfgVehicles.hpp @@ -1,7 +1,6 @@ class CfgVehicles { class StaticMGWeapon; class rhs_DSHKM_base: StaticMGWeapon { - // ENABLE_CSW_ATTRIBUTE; class ACE_CSW { enabled = 1; proxyWeapon = QGVAR(rhs_weap_DSHKM); diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp index 8dc735265c..b87223ae27 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_arsenal/CfgWeapons.hpp @@ -3,6 +3,9 @@ class CfgWeapons { class acc_pointer_IR; class rhsusf_acc_anpeq15: acc_pointer_IR { baseWeapon = "rhsusf_acc_anpeq15"; + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; class rhsusf_acc_anpeq15_bk: rhsusf_acc_anpeq15 { baseWeapon = "rhsusf_acc_anpeq15_bk"; @@ -28,8 +31,12 @@ class CfgWeapons { class rhsusf_acc_wmx_bk: rhsusf_acc_M952V { baseWeapon = "rhsusf_acc_wmx_bk"; }; + class rhsusf_acc_anpeq15A: acc_pointer_IR { baseWeapon = "rhsusf_acc_anpeq15A"; + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; class rhsusf_acc_anpeq15_top: rhsusf_acc_anpeq15A { baseWeapon = "rhsusf_acc_anpeq15_top"; @@ -37,8 +44,12 @@ class CfgWeapons { class rhsusf_acc_anpeq15_bk_top: rhsusf_acc_anpeq15_top { baseWeapon = "rhsusf_acc_anpeq15_bk_top"; }; + class rhsusf_acc_anpeq15side: acc_pointer_IR { baseWeapon = "rhsusf_acc_anpeq15side"; + MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat + MRT_SwitchItemNextClass = ""; + MRT_SwitchItemPrevClass = ""; }; class rhsusf_acc_anpeq15side_bk: rhsusf_acc_anpeq15side { baseWeapon = "rhsusf_acc_anpeq15side_bk"; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/stringtable.xml b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/stringtable.xml index bb185513a7..bc2413a2ca 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_csw/stringtable.xml +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_csw/stringtable.xml @@ -10,6 +10,7 @@ [CSW] BGM-71A TOW [CSW] BGM-71A TOW [CSW] BGM-71A TOW + [CSW] BGM-71A TOW [CSW] BGM-71B TOW @@ -20,6 +21,7 @@ [CSW] BGM-71B TOW [CSW] BGM-71B TOW [CSW] BGM-71B TOW + [CSW] BGM-71B TOW [CSW] BGM-71C ITOW @@ -30,6 +32,7 @@ [CSW] BGM-71C ITOW [CSW] BGM-71C ITOW [CSW] BGM-71C ITOW + [CSW] BGM-71C ITOW [CSW] BGM-71D TOW-2 @@ -40,6 +43,7 @@ [CSW] BGM-71D TOW-2 [CSW] BGM-71D TOW-2 [CSW] BGM-71D TOW-2 + [CSW] BGM-71D TOW-2 [CSW] BGM-71E TOW-2A @@ -50,6 +54,7 @@ [CSW] BGM-71E TOW-2A [CSW] BGM-71E TOW-2A [CSW] BGM-71E TOW-2A + [CSW] BGM-71E TOW-2A [CSW] BGM-71F TOW-2B @@ -60,6 +65,7 @@ [CSW] BGM-71F TOW-2B [CSW] BGM-71F TOW-2B [CSW] BGM-71F TOW-2B + [CSW] BGM-71F TOW-2B [CSW] BGM-71F-3 TOW-2B AERO @@ -70,6 +76,7 @@ [CSW] BGM-71F-3 TOW-2B AERO [CSW] BGM-71F-3 TOW-2B AERO [CSW] BGM-71F-3 TOW-2B AERO + [CSW] BGM-71F-3 TOW-2B AERO [CSW] BGM-71H Bunker Buster @@ -80,6 +87,7 @@ [CSW] BGM-71H Anti-Búnquer [CSW] BGM-71H Bunker Buster [CSW] BGM-71H Anti-Bunker + [CSW] BGM-71H Bunker Buster [CSW] Mk. 19 40mm M384 HE @@ -90,6 +98,7 @@ [CSW] Mk. 19 40mm M384 HE [CSW] Mk. 19 40mm M384 HE [CSW] Mk. 19 40mm M384 HE + [CSW] Mk. 19 40mm M384 HE [CSW] Mk. 19 40mm M430I HEDP @@ -100,6 +109,7 @@ [CSW] Mk. 19 40mm M430I HEDP [CSW] Mk. 19 40mm M430I HEDP [CSW] Mk. 19 40mm M430I HEDP + [CSW] Mk. 19 40mm M430I HEDP [CSW] Mk. 19 40mm M430A1 HEDP @@ -110,6 +120,7 @@ [CSW] Mk. 19 40mm M430A1 HEDP [CSW] Mk. 19 40mm M430A1 HEDP [CSW] Mk. 19 40mm M430A1 HEDP + [CSW] Mk. 19 40mm M430A1 HEDP [CSW] Mk. 19 40mm M1001 Canister @@ -120,6 +131,7 @@ [CSW] Mk. 19 40mm M1001 Bote de metralla [CSW] Mk. 19 40mm M1001 Kanister [CSW] Mk. 19 40mm M1001 Pallettoni + [CSW] Mk. 19 40 mm M1001 Chevrotine diff --git a/addons/compat_sog/stringtable.xml b/addons/compat_sog/stringtable.xml index 06f0827d08..fc64aef97c 100644 --- a/addons/compat_sog/stringtable.xml +++ b/addons/compat_sog/stringtable.xml @@ -12,6 +12,7 @@ Закопать Enterrarse Escavar + Creuser M49A2 60mm HE @@ -24,6 +25,7 @@ M49A2 60 мм ОФ M49A2 60mm HE M49A2 60mm HE + M49A2 60mm HE M302 60mm WP @@ -36,6 +38,7 @@ M302 60 мм Фосфорная M302 60mm WP M302 60mm WP + M302 60mm Phosphore Blanc M83 60mm Lume @@ -48,6 +51,7 @@ M83 60 мм Осветительная M83 60mm Iluminación M83 60mm Iluminação + M83 60 mm Eclairant M374 81mm HE @@ -60,6 +64,7 @@ M374 81 мм ОФ M374 81mm HE M374 81mm HE + M374 81mm HE M375 81mm WP @@ -72,6 +77,7 @@ M375 81 мм Фосфорная M375 81mm WP M375 81mm WP + M375 81mm Phosphore Blanc M301A3 81mm Lume @@ -84,6 +90,7 @@ M301A3 81 мм Осветительная M301A3 81mm Iluminación M301A3 81mm Iluminação + M301A3 81mm Eclairant M57 81mm Smoke @@ -96,6 +103,7 @@ M57 81 мм Дымовая M57 81mm Smoke M57 81mm Fumígena + M57 81mm Fumigène O-832D 82mm HE @@ -108,6 +116,7 @@ О-832Д 82 мм ОФ O-832D 82mm HE O-832D 82mm HE + O-832D 82mm HE D-832 82mm WP @@ -120,6 +129,7 @@ Д-832 82 мм Фосфорная D-832 82mm WP D-832 82mm WP + D-832 82mm Phosphore Blanc S-832S 82mm Lume @@ -132,6 +142,7 @@ С-832С 82 мм Осветительная S-832S 82mm Iluminación S-832S 82mm Iluminação + S-832S 82mm Eclairant [ACE] M49A2 60mm HE Box @@ -144,6 +155,7 @@ [ACE] Коробка M49A2 60 мм ОФ [ACE] M49A2 60mm Caja de HE [ACE] M49A2 60mm Caixa de HE + [ACE] Scatola M49A2 60mm HE [ACE] M302 60mm WP Box @@ -156,6 +168,7 @@ [ACE] Коробка M302 60 мм Фосфорных [ACE] M302 60mm Caja de WP [ACE] M302 60mm Caixa de WP + [ACE] M302 60mm Phosphore Blanc Box [ACE] M83 60mm Lume Box @@ -168,6 +181,7 @@ [ACE] Коробка M83 60 мм Осветительных [ACE] M83 60mm Caja de Iluminación [ACE] M83 60mm Caixa de Iluminação + [ACE] M83 60mm Eclairant Box [ACE] M374 81mm HE Box @@ -180,6 +194,7 @@ [ACE] Коробка M374 81 мм ОФ [ACE] M374 81mm Caja de HE [ACE] M374 81mm Caixa de HE + [ACE] Scatola M374 81mm HE [ACE] M375 81mm WP Box @@ -192,6 +207,7 @@ [ACE] Коробка M375 81 мм Фосфорных [ACE] M375 81mm Caja de WP [ACE] M375 81mm Caixa de WP + [ACE] M375 81mm Phosphore Blanc Box [ACE] M301A3 81mm Lume Box @@ -204,6 +220,7 @@ [ACE] Коробка M301A3 81 мм Осветительных [ACE] M301A3 81mm Caja de Iluminación [ACE] M301A3 81mm Caixa de Iluminação + [ACE] M301A3 81mm Eclairant Box [ACE] M57 81mm Smoke Box @@ -216,6 +233,7 @@ [ACE] Коробка M57 81 мм Дымовых [ACE] M57 81mm Caja de Humo [ACE] M57 81mm Caixa de Fumígena + [ACE] M57 81mm Fumigène Box [ACE] O-832D 82mm HE Box @@ -228,6 +246,7 @@ [ACE] Коробка О-832Д 82 мм ОФ [ACE] O-832D 82mm Caja de HE [ACE] O-832D 82mm Caixa de HE + [ACE] Scatola O-832D 82mm HE [ACE] D-832 82mm WP Box @@ -240,6 +259,7 @@ [ACE] Коробка Д-832 82 мм Фосфорных [ACE] D-832 82mm Caja de WP [ACE] D-832 82mm Caixa de WP + [ACE] D-832 82mm Phosphore Blanc Box [ACE] S-832S 82mm Lume Box @@ -252,6 +272,7 @@ [ACE] Коробка С-832С 82 мм Осветительных [ACE] S-832S 82mm Caja de Iluminación [ACE] S-832S 82mm Caixa de Iluminação + [ACE] S-832S 82mm Eclairant Box Dig Spiderhole @@ -264,6 +285,7 @@ Выкопать паучью дыру Excavar Agujero de araña Escavar buraco de aranha + Creuser un trou d'araignée Dig Spiderhole (Angled Cover) @@ -276,6 +298,7 @@ Выкопать крытую паучью дыру Excavar Agujero de araña (Cubierta inclinada) Escavar buraco de aranha (Cobertura inclinada) + Creuser un trou d'araignée (couverture d'angle) Dig Spiderhole (Dual) @@ -288,6 +311,7 @@ Выкопать двойную паучью дыру Excavar Agujero de araña (Doble) Escavar buraco de aranha (Duplo) + Creuser un trou d'araignée (double) [CSW] M1919A4 Gun Bag @@ -300,6 +324,7 @@ [CSW] Сумка с M1919A4 [CSW] M1919A4 Bolsa para arma [CSW] Bolsa para M1919A4 + [CSW] M1919A4 Gun Bag [CSW] M1919A6 Gun Bag @@ -312,6 +337,7 @@ [CSW] Сумка с M1919A6 [CSW] M1919A6 Bolsa para arma [CSW] Bolsa para M1919A6 + [CSW] M1919A6 Gun Bag [CSW] M60 Gun Bag @@ -324,6 +350,7 @@ [CSW] Сумка с M60 [CSW] M60 Bolsa para arma [CSW] Bolsa para M60 + [CSW] M60 Gun Bag [CSW] DShK (Shield) Gun Bag @@ -336,6 +363,7 @@ [CSW] Сумка с ДШК (со щитом) [CSW] DShK (Apantallada) Bolsa para arma [CSW] Bolsa para DShK (Escudo) + [CSW] DShK (Shield) Gun Bag [CSW] DShK (AA) Gun Bag @@ -348,6 +376,7 @@ [CSW] Сумка с ДШК (зенитный) [CSW] DShK (AA) Bolsa para arma [CSW] Bolsa para DShK (AA) + [CSW] DShK (AA) Gun Bag [CSW] RPD Gun Bag @@ -360,6 +389,7 @@ [CSW] Сумка с РПД [CSW] RPD Bolsa para arma [CSW] Bolsa para RPD + [CSW] RPD Gun Bag [CSW] PK Gun Bag @@ -372,6 +402,7 @@ [CSW] Сумка с ПК [CSW] PK Bolsa para arma [CSW] Bolsa para PK + [CSW] PK Sac d'armes [CSW] MG42 Gun Bag @@ -384,6 +415,7 @@ [CSW] Сумка с MG42 [CSW] MG42 Bolsa para arma [CSW] Bolsa para MG42 + [CSW] MG42 Sac d'armes [CSW] SGM Gun Bag @@ -396,6 +428,7 @@ [CSW] Сумка с СГМ [CSW] SGM Bolsa para arma [CSW] Bolsa para SGM + [CSW] SGM Sac d'armes [CSW] SGM (Shield) Gun Bag @@ -408,6 +441,7 @@ [CSW] Сумка с СГМ (со щитом) [CSW] SGM (Apantallada) Bolsa para arma [CSW] Bolsa para SGM (Escudo) + [CSW] SGM Sac d'armes (avec bouclier) [CSW] Mk18 Gun Bag @@ -420,6 +454,7 @@ [CSW] Сумка с Mk18 [CSW] Mk18 Bolsa para arma [CSW] Bolsa para Mk18 + [CSW] Mk18 Sac d'armes [CSW] M29 Mortar Tube @@ -432,6 +467,7 @@ [CSW] Сумка с миномётом M29 [CSW] M29 Tubo de Mortero [CSW] M29 Tubo de Morteiro + [CSW] Tube de mortier M29 [CSW] M2 Mortar Tube @@ -444,6 +480,7 @@ [CSW] Сумка с миномётом M2 [CSW] M2 Tubo de mortero [CSW] M2 Tubo de Morteiro + [CSW] Tube de mortier M2 [CSW] Type 53 Mortar Tube @@ -456,6 +493,7 @@ [CSW] Сумка с миномётом Type 53 [CSW] Type 53 Tubo de mortero [CSW] Type 53 Tubo de Morteiro + [CSW] Tube de mortier Type 53 diff --git a/addons/compat_spe/CfgAmmo.hpp b/addons/compat_spe/CfgAmmo.hpp index 0917727974..d11510648b 100644 --- a/addons/compat_spe/CfgAmmo.hpp +++ b/addons/compat_spe/CfgAmmo.hpp @@ -3,4 +3,5 @@ class CfgAmmo { #include "CfgAmmo\explosives.hpp" #include "CfgAmmo\grenades.hpp" #include "CfgAmmo\melee.hpp" + #include "CfgAmmo\bullets.hpp" }; diff --git a/addons/compat_spe/CfgAmmo/bullets.hpp b/addons/compat_spe/CfgAmmo/bullets.hpp new file mode 100644 index 0000000000..1e0e22e62d --- /dev/null +++ b/addons/compat_spe/CfgAmmo/bullets.hpp @@ -0,0 +1,12 @@ +class SPE_Bullet_Vehicle_base; + +class SPE_B_127x99_Mixed: SubmunitionBase { + ACE_caliber = 12.954; +}; + +class SPE_B_127x99_Ball: SPE_Bullet_Vehicle_base { + ACE_caliber = 12.954; +}; +class SPE_B_127x99_API: SPE_B_127x99_Ball { + EGVAR(vehicle_damage,incendiary) = 1; +}; diff --git a/addons/compat_spe/CfgMagazines.hpp b/addons/compat_spe/CfgMagazines.hpp index e3ac58ca41..c5e0b54c75 100644 --- a/addons/compat_spe/CfgMagazines.hpp +++ b/addons/compat_spe/CfgMagazines.hpp @@ -1,3 +1,4 @@ class CfgMagazines { #include "CfgMagazines\csw.hpp" + #include "CfgMagazines\flamethrower.hpp" }; diff --git a/addons/compat_spe/CfgMagazines/flamethrower.hpp b/addons/compat_spe/CfgMagazines/flamethrower.hpp new file mode 100644 index 0000000000..fc1d67558d --- /dev/null +++ b/addons/compat_spe/CfgMagazines/flamethrower.hpp @@ -0,0 +1,3 @@ +class SPE_Flamethrower_Mag: CA_Magazine { + type = 256; +}; diff --git a/addons/compat_ws/CfgWeapons.hpp b/addons/compat_ws/CfgWeapons.hpp index 10e4b68eb2..30e6882b08 100644 --- a/addons/compat_ws/CfgWeapons.hpp +++ b/addons/compat_ws/CfgWeapons.hpp @@ -20,11 +20,13 @@ class CfgWeapons { ACE_barrelLength = 550; ACE_barrelTwist = 304.8; ACE_twistDirection = 1; + EGVAR(overheating,allowSwapBarrel) = 1; }; class LMG_S77_Compact_base_lxWS: LMG_S77_base_lxWS { ACE_barrelLength = 500; ACE_barrelTwist = 304.8; ACE_twistDirection = 1; + EGVAR(overheating,allowSwapBarrel) = 1; }; // SLR diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index b9341cf19f..092fd2a9ea 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -7,6 +7,8 @@ AA12 AA12 AA12 + AA12 + AA12 AA12 (Sand) @@ -14,6 +16,8 @@ AA12 (Sand) AA12 (Sabbia) AA12 (サンド) + AA12 (Песочный) + AA12 (Sable) AA12 (Snake) @@ -21,6 +25,7 @@ AA12 (Schlange) AA12 (Serpe) AA12 (ヘビ柄) + AA12 (Змея) Galil ARM @@ -28,6 +33,8 @@ Galil ARM Galil ARM ガリル ARM + Galil ARM + Galil ARM Galil ARM (Old) @@ -35,6 +42,8 @@ Galil ARM (Alt) Galil ARM (Vecchio) ガリル ARM (使い古し) + Galil ARM (Старый) + Galil ARM (Ancien) GLX 160 @@ -42,6 +51,8 @@ GLX 160 GLX-160 GLX 160 + GLX 160 + GLX 160 GLX 160 (Snake) @@ -49,20 +60,25 @@ GLX 160 (Schlange) GLX-160 (Serpe) GLX 160 (ヘビ柄) + GLX 160 (Змея) GLX 160 (Hex) GLX-160 (육각) GLX 160 (Hex) GLX-160 (Hex) - GLX 160 (ヘックス) + GLX 160 (六角形迷彩) + GLX 160 (Гекс) + GLX 160 (Hex) GLX 160 (Green Hex) GLX-160 (초록육각) GLX 160 (Grün Hex) GLX-160 (Hex Verde) - GLX 160 (緑ヘックス) + GLX 160 (緑六角形迷彩) + GLX 160 (Зеленый Гекс) + GLX 160 (Vert Hex) GLX 160 (Camo) @@ -70,6 +86,8 @@ GLX 160 (Tarn) GLX-160 (Mimetica) GLX 160 (迷彩) + GLX 160 (Камуфляж) + GLX 160 (Camo) GLX 160 (Sand) @@ -77,6 +95,8 @@ GLX 160 (Sand) GLX-160 (Sabbia) GLX 160 (サンド) + GLX 160 (Песочный) + GLX 160 (Sable) Mk14 Mod 1 EBR (Black) @@ -84,6 +104,8 @@ Mk14 Mod 1 EBR (Schwarz) Mk14 Mod 1 EBR (Nero) Mk14 Mod 1 EBR (ブラック) + Mk14 Mod 1 EBR (Черный) + Mk14 Mod 1 EBR (Noir) Mk14 Mod 1 EBR (Snake) @@ -91,12 +113,15 @@ Mk14 Mod 1 EBR (Schlange) Mk14 Mod 1 EBR (Serpe) Mk14 Mod 1 EBR (ヘビ柄) + Mk14 Mod 1 EBR (Змея) Vektor SS-77 벡터 SS-77 Vektor SS-77 ヴェクター SS-77 + Vektor SS-77 + Vektor SS-77 Vektor SS-77 (Camo) @@ -104,20 +129,26 @@ Vektor SS-77 (Tarn) Vektor SS-77 (Mimetica) ヴェクター SS-77 (迷彩) + Vektor SS-77 (Камуфляж) + Vektor SS-77 (Camo) Vektor SS-77 (Hex) 벡터 SS-77 (육각) Vektor SS-77 (Hex) Vektor SS-77 (Hex) - ヴェクター SS-77 (ヘックス) + ヴェクター SS-77 (六角形迷彩) + Vektor SS-77 (гекс) + Vektor SS-77 (Hex) Vektor SS-77 (Green Hex) 벡터 SS-77 (초록육각) Vektor SS-77 (Grün Hex) Vektor SS-77 (Hex Verde) - ヴェクター SS-77 (緑ヘックス) + ヴェクター SS-77 (緑六角形迷彩) + Vektor SS-77 (зеленый гекс) + Vektor SS-77 (VertHex) Vektor SS-77 (Desert) @@ -125,6 +156,8 @@ Vektor SS-77 (Wüste) Vektor SS-77 (Deserto) ヴェクター SS-77 (砂漠迷彩) + Vektor SS-77 (песочныйt) + Vektor SS-77 (Désert) Vektor SS-77 Compact @@ -132,6 +165,8 @@ Vektor SS-77 Kompakt Vektor SS-77 Compatto ヴェクター SS-77 コンパクト + Vektor SS-77 Compact + Vektor SS-77 Compacte Vektor SS-77 Compact (Snake) @@ -139,6 +174,7 @@ Vektor SS-77 Compact (Schlange) Vektor SS-77 Compatto (Serpe) ヴェクター SS-77 コンパクト (ヘビ柄) + Vektor SS-77 Compact (змея) FN FAL 50.00 (Wood) @@ -146,6 +182,8 @@ FN FAL 50.00 (Holz) FN FAL 50.00 (Legno) FN FAL 50.00 (森林迷彩) + FN FAL 50.00 (лесной) + FN FAL 50.00 (Bois) FN FAL 50.00 GL (Wood) @@ -153,6 +191,8 @@ FN FAL 50.00 GL (Holz) FN FAL 50.00 GL (Legno) FN FAL 50.00 GL (森林迷彩) + FN FAL 50.00 GL (лесной) + FN FAL 50.00 GL (Bois) FN FAL 50.00 @@ -160,6 +200,8 @@ FN FAL 50.00 FN FAL 50.00 FN FAL 50.00 + FN FAL 50.00 + FN FAL 50.00 FN FAL 50.00 GL @@ -167,6 +209,8 @@ FN FAL 50.00 GL FN FAL 50.00 GL FN FAL 50.00 GL + FN FAL 50.00 GL + FN FAL 50.00 GL FN FAL 50.00 (Desert) @@ -174,6 +218,8 @@ FN FAL 50.00 (Wüstet) FN FAL 50.00 (Deserto) FN FAL 50.00 (砂漠迷彩) + FN FAL 50.00 (песочный) + FN FAL 50.00 (Désert) FN FAL 50.00 (Jungle) @@ -181,6 +227,8 @@ FN FAL 50,00 (Dschungel) FN FAL 50,00 (Giungla) FN FAL 50.00 (熱帯迷彩) + FN FAL 50.00 (джунгли) + FN FAL 50.00 (Jungle) Vektor R4 @@ -188,6 +236,8 @@ Vektor R4 Vektor R4 ヴェクター R5 + Vektor R4 + Vektor R4 Vektor R5 Carbine @@ -195,6 +245,8 @@ Vektor R5 Carbine Vektor R5 Carabina ヴェクター R5 カービン + Vektor R5 Carbine + Vektor R5 Carbine Vektor R5 Carbine GL @@ -202,6 +254,8 @@ Vektor R5 Carbine GL Vektor R5 Carabina GL ヴェクター R5 カービン GL + Vektor R5 Carbine GL + Vektor R5 Carbine GL Vektor R5 Carbine (Snake) @@ -209,6 +263,7 @@ Vektor R5 Carbine (Schlange) Vektor R5 Carabina (Serpe) ヴェクター R5 カービン (ヘビ柄) + Vektor R5 Carbine (Змея) Vektor R5 Carbine GL (Snake) @@ -216,6 +271,7 @@ Vektor R5 Carbine GL (Schlange) Vektor R5 Carabina GL (Serpe) ヴェクター R5 カービン GL (ヘビ柄) + Vektor R5 Carbine GL (Змея) XMS diff --git a/addons/concertina_wire/XEH_postInit.sqf b/addons/concertina_wire/XEH_postInit.sqf index 7cb8909c81..bb3f022534 100644 --- a/addons/concertina_wire/XEH_postInit.sqf +++ b/addons/concertina_wire/XEH_postInit.sqf @@ -10,4 +10,4 @@ GVAR(deployPFH) = -1; }; }] call CBA_fnc_addEventHandler; -[QGVAR(vehicleDamage), {_this call FUNC(vehicleDamage)}] call CBA_fnc_addEventHandler; +[QGVAR(vehicleDamage), LINKFUNC(vehicleDamage)] call CBA_fnc_addEventHandler; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index 579bc73f97..c915109e1b 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -22,7 +22,7 @@ params ["_wirecoil", "_unit"]; private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; { _wireNoGeo animate [_x, 1]; -} count WIRE_FAST; +} forEach WIRE_FAST; GVAR(placer) = _unit; private _dir = getDir _unit; @@ -51,7 +51,7 @@ GVAR(deployPFH) = [{ private _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; { _wire animate [_x, _anim]; - } count WIRE_FAST; + } forEach WIRE_FAST; [{ params ["_args", "_idPFH"]; @@ -74,7 +74,7 @@ GVAR(deployPFH) = [{ _wireNoGeo setDir _dir; { _wireNoGeo animate [_x, _anim]; - } count WIRE_FAST; + } forEach WIRE_FAST; }, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; [LLSTRING(RollWire), "", ""] call EFUNC(interaction,showMouseHint); diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index 3a90b62a91..86aac9e8bf 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -20,7 +20,7 @@ params ["_wire"]; { _wire animate [_x, 1]; -} count WIRE_FAST; +} forEach WIRE_FAST; [{ params ["_args", "_idPFH"]; diff --git a/addons/cookoff/CfgSounds.hpp b/addons/cookoff/CfgSounds.hpp new file mode 100644 index 0000000000..742fb589d9 --- /dev/null +++ b/addons/cookoff/CfgSounds.hpp @@ -0,0 +1,66 @@ +#define VOLUME 2 +#define PITCH 1 + +#define SHOTSOUND(type,dist,N,maxDistance)\ +class GVAR(TRIPLES(type,dist,N)) {\ + sound[] = {QPATHTOF(sounds\type\DOUBLES(dist,N).wss), VOLUME, PITCH, maxDistance};\ + titles[] = {};\ +} + +#define SHOTSOUNDCLASS(type,dist,maxDistance)\ +SHOTSOUND(type,dist,1,maxDistance);\ +SHOTSOUND(type,dist,2,maxDistance);\ +SHOTSOUND(type,dist,3,maxDistance) + +#define SHOTSOUNDCLASSTYPE(type,maxDistance)\ +SHOTSOUNDCLASS(type,close,maxDistance);\ +SHOTSOUNDCLASS(type,mid,maxDistance);\ +SHOTSOUNDCLASS(type,far,maxDistance) + +// Allows other mods to change sounds for cook-off +class CfgSounds { + // These macros set up the sounds for the various classes + SHOTSOUNDCLASSTYPE(shotbullet,1250); + SHOTSOUNDCLASSTYPE(shotrocket,1600); + SHOTSOUNDCLASSTYPE(shotshell,1300); + + // Missiles use the same sounds as rockets + class GVAR(shotmissile_close_1): GVAR(shotrocket_close_1) {}; + class GVAR(shotmissile_close_2): GVAR(shotrocket_close_2) {}; + class GVAR(shotmissile_close_3): GVAR(shotrocket_close_3) {}; + class GVAR(shotmissile_mid_1): GVAR(shotrocket_mid_1) {}; + class GVAR(shotmissile_mid_2): GVAR(shotrocket_mid_2) {}; + class GVAR(shotmissile_mid_3): GVAR(shotrocket_mid_3) {}; + class GVAR(shotmissile_far_1): GVAR(shotrocket_far_1) {}; + class GVAR(shotmissile_far_2): GVAR(shotrocket_far_2) {}; + class GVAR(shotmissile_far_3): GVAR(shotrocket_far_3) {}; + + // Submunitions have the same sound as bullets, but a higher maxDistance + class GVAR(shotsubmunitions_close_1): GVAR(shotbullet_close_1) { + sound[] = {QPATHTOF(sounds\shotbullet\close_1.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_close_2): GVAR(shotbullet_close_2) { + sound[] = {QPATHTOF(sounds\shotbullet\close_2.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_close_3): GVAR(shotbullet_close_3) { + sound[] = {QPATHTOF(sounds\shotbullet\close_3.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_mid_1): GVAR(shotbullet_far_1) { + sound[] = {QPATHTOF(sounds\shotbullet\mid_1.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_mid_2): GVAR(shotbullet_mid_2) { + sound[] = {QPATHTOF(sounds\shotbullet\mid_2.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_mid_3): GVAR(shotbullet_mid_3) { + sound[] = {QPATHTOF(sounds\shotbullet\mid_3.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_far_1): GVAR(shotbullet_far_1) { + sound[] = {QPATHTOF(sounds\shotbullet\far_1.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_far_2): GVAR(shotbullet_far_2) { + sound[] = {QPATHTOF(sounds\shotbullet\far_2.wss), VOLUME, PITCH, 1600}; + }; + class GVAR(shotsubmunitions_far_3): GVAR(shotbullet_far_3) { + sound[] = {QPATHTOF(sounds\shotbullet\far_3.wss), VOLUME, PITCH, 1600}; + }; +}; diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index b9c8101595..eba4eeced0 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -1,28 +1,28 @@ #include "script_component.hpp" -[QGVAR(engineFire), FUNC(engineFire)] call CBA_fnc_addEventHandler; +[QGVAR(engineFire), LINKFUNC(engineFire)] call CBA_fnc_addEventHandler; [QGVAR(cookOff), { params ["_vehicle"]; if (local _vehicle) then { _this call FUNC(cookOff); }; }] call CBA_fnc_addEventHandler; -[QGVAR(cookOffEffect), FUNC(cookOffEffect)] call CBA_fnc_addEventHandler; -[QGVAR(smoke), FUNC(smoke)] call CBA_fnc_addEventHandler; -[QGVAR(cookOffBox), FUNC(cookOffBox)] call CBA_fnc_addEventHandler; +[QGVAR(cookOffEffect), LINKFUNC(cookOffEffect)] call CBA_fnc_addEventHandler; +[QGVAR(smoke), LINKFUNC(smoke)] call CBA_fnc_addEventHandler; +[QGVAR(cookOffBox), LINKFUNC(cookOffBox)] call CBA_fnc_addEventHandler; // handle cleaning up effects when vehicle is deleted mid-cookoff [QGVAR(addCleanupHandlers), { params ["_vehicle"]; - + // Don't add a new EH if cookoff is run multiple times if ((_vehicle getVariable [QGVAR(deletedEH), -1]) == -1) then { private _deletedEH = _vehicle addEventHandler ["Deleted", { params ["_vehicle"]; - + [QGVAR(cleanupEffects), [_vehicle]] call CBA_fnc_localEvent; }]; - + _vehicle setVariable [QGVAR(deletedEH), _deletedEH]; }; }] call CBA_fnc_addEventHandler; @@ -58,3 +58,42 @@ [FUNC(detonateAmmunition), [_vehicle, _mags, _total], _delay] call CBA_fnc_waitAndExecute; }; }, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler; + +if (hasInterface) then { + // Plays a sound locally, so that different sounds can be used for various distances + [QGVAR(playCookoffSound), { + params ["_object", "_sound"]; + + if (isNull _object) exitWith {}; + + private _distance = _object distance (positionCameraToWorld [0, 0, 0]); + + TRACE_3("",_object,_sound,_maxDistance); + + // 3 classes of distances: close, mid and far, each having different sound files + private _classDistance = switch (true) do { + case (_distance < DISTANCE_CLOSE): {"close"}; + case (_distance < DISTANCE_MID): {"mid"}; + default {"far"}; + }; + + _sound = format [QGVAR(%1_%2_%3), _sound, _classDistance, floor (random 3) + 1]; + + TRACE_1("",_sound); + + // Allows other mods to change sounds for cook-off + _sound = getArray (configFile >> "CfgSounds" >> _sound >> "sound"); + + if (_sound isEqualTo []) exitWith {}; + + _sound params ["_sound", "_volume", "_pitch", "_maxDistance"]; + + if (_distance > _maxDistance) exitWith {}; + + // Make sure file exists, so RPT isn't spammed with non-existent entry errors + if (!fileExists _sound) exitWith {}; + + // Obeys speed of sound and takes doppler effects into account + playSound3D [_sound, objNull, insideBuilding _object >= 0.5, getPosASL _object, _volume, _pitch + (random 0.2) - 0.1, _maxDistance, 0, true]; + }] call CBA_fnc_addEventHandler; +}; diff --git a/addons/cookoff/config.cpp b/addons/cookoff/config.cpp index 4fba15f5e1..dc7a472855 100644 --- a/addons/cookoff/config.cpp +++ b/addons/cookoff/config.cpp @@ -21,4 +21,5 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgCloudlets.hpp" #include "CfgSFX.hpp" +#include "CfgSounds.hpp" #include "CfgVehicles.hpp" diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 1d598cdb96..57cde71682 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -36,7 +36,7 @@ _vehicle setVariable [QGVAR(isCookingOff), true, true]; // limit maximum value of intensity to prevent very long cook-off times _intensity = _intensity min _maxIntensity; -private _config = _vehicle call CBA_fnc_getObjectConfig; +private _config = configOf _vehicle; private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {(_vehicle selectionPosition _x) isNotEqualTo [0,0,0]}; if (_positions isEqualTo []) then { diff --git a/addons/cookoff/functions/fnc_cookOffEffect.sqf b/addons/cookoff/functions/fnc_cookOffEffect.sqf index a907f67606..44282f2f6b 100644 --- a/addons/cookoff/functions/fnc_cookOffEffect.sqf +++ b/addons/cookoff/functions/fnc_cookOffEffect.sqf @@ -40,7 +40,7 @@ if (isServer) then { if (_ring) then { private _intensity = 6; private _radius = 1.5 * ((boundingBoxReal _obj) select 2); - [QEGVAR(fire,addFireSource), [_obj, _radius, _intensity, _obj]] call CBA_fnc_localEvent; + [QEGVAR(fire,addFireSource), [_obj, _radius, _intensity, format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; }; }; @@ -52,7 +52,7 @@ if (isServer) then { deleteVehicle _light; deleteVehicle _sound; if (isServer) then { - [QEGVAR(fire,removeFireSource), [_obj]] call CBA_fnc_localEvent; + [QEGVAR(fire,removeFireSource), [format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; }; [_pfh] call CBA_fnc_removePerFrameHandler; }; @@ -198,4 +198,3 @@ if (isServer) then { ]; }, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound, _intensity]] call CBA_fnc_addPerFrameHandler; - diff --git a/addons/cookoff/functions/fnc_detonateAmmunition.sqf b/addons/cookoff/functions/fnc_detonateAmmunition.sqf index b4d48f3120..9b3c19ab42 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunition.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunition.sqf @@ -32,90 +32,89 @@ private _magazineIndex = floor random(count _magazines); private _magazine = _magazines select _magazineIndex; _magazine params ["_magazineClassname", "_amountOfMagazines"]; -if (_amountOfMagazines > 0) exitWith { - private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration))); +if (_amountOfMagazines < 0) exitWith { + ERROR_1("mag with no ammo - %1",_magazine); +}; +private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration))); - _amountOfMagazines = _amountOfMagazines - _removed; - if (_amountOfMagazines <= 0) then { - _magazines deleteAt _magazineIndex; +_amountOfMagazines = _amountOfMagazines - _removed; +if (_amountOfMagazines <= 0) then { + _magazines deleteAt _magazineIndex; +} else { + _magazine set [1, _amountOfMagazines]; // clear out the magazine +}; +private _timeBetweenAmmoDetonation = (((random 10) / (sqrt _totalAmmo)) min MAX_TIME_BETWEEN_AMMO_DET) max 0.1; +TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation); +_totalAmmo = _totalAmmo - _removed; + +private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "ammo"); +private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; + +private _speedOfAmmo = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "initSpeed"); +private _simType = getText (_ammoCfg >> "simulation"); + +private _effect2pos = _vehicle selectionPosition "destructionEffect2"; + +private _spawnProjectile = { + params ["_vehicle", "_ammo", "_speed", "_flyAway"]; + + private _spawnPos = _vehicle modelToWorld [-0.2 + (random 0.4), -0.2 + (random 0.4), random 3]; + if (_spawnPos select 2 < 0) then { + _spawnPos set [2, 0]; + }; + + private _projectile = createVehicle [_ammo, _spawnPos, [], 0, "CAN_COLLIDE"]; + if (_flyAway) then { + private _vectorAmmo = [(-1 + (random 2)), (-1 + (random 2)), -0.2 + (random 1)]; + private _velVec = _vectorAmmo vectorMultiply _speed; + _projectile setVectorDir _velVec; + _projectile setVelocity _velVec; } else { - _magazine set [1, _amountOfMagazines]; // clear out the magazine - }; - private _timeBetweenAmmoDetonation = (((random 10) / (sqrt _totalAmmo)) min MAX_TIME_BETWEEN_AMMO_DET) max 0.1; - TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation); - _totalAmmo = _totalAmmo - _removed; - - private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "ammo"); - private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; - - private _speedOfAmmo = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "initSpeed"); - private _simType = getText (_ammoCfg >> "simulation"); - - private _effect2pos = _vehicle selectionPosition "destructionEffect2"; - - private _spawnProjectile = { - params ["_vehicle", "_ammo", "_speed", "_flyAway"]; - - private _spawnPos = _vehicle modelToWorld [-0.2 + (random 0.4), -0.2 + (random 0.4), random 3]; - if (_spawnPos select 2 < 0) then { - _spawnPos set [2, 0]; - }; - - private _projectile = createVehicle [_ammo, _spawnPos, [], 0, "CAN_COLLIDE"]; - if (_flyAway) then { - private _vectorAmmo = [(-1 + (random 2)), (-1 + (random 2)), -0.2 + (random 1)]; - private _velVec = _vectorAmmo vectorMultiply _speed; - _projectile setVectorDir _velVec; - _projectile setVelocity _velVec; - } else { - _projectile setDamage 1; - }; - - _projectile; + _projectile setDamage 1; }; - private _speed = random (_speedOfAmmo / 10) max 1; - - if (toLower _simType == "shotbullet") then { - private _sound = selectRandom [QUOTE(PATHTO_R(sounds\light_crack_close.wss)), QUOTE(PATHTO_R(sounds\light_crack_close_filtered.wss)), QUOTE(PATHTO_R(sounds\heavy_crack_close.wss)), QUOTE(PATHTO_R(sounds\heavy_crack_close_filtered.wss))]; - playSound3D [_sound, objNull, false, (getPosASL _vehicle), 2, 1, 1250]; + _projectile; +}; +private _speed = random (_speedOfAmmo / 10) max 1; +_simType = toLowerANSI _simType; +switch (_simType) do { + case ("shotbullet"): { + [QGVAR(playCookoffSound), [_vehicle, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.6) then { [_vehicle, _ammo, _speed, true] call _spawnProjectile; }; }; - if (toLower _simType == "shotshell") then { - private _sound = selectRandom [QUOTE(PATHTO_R(sounds\heavy_crack_close.wss)), QUOTE(PATHTO_R(sounds\heavy_crack_close_filtered.wss))]; - playSound3D [_sound, objNull, false, (getPosASL _vehicle), 2, 1, 1300]; - + case ("shotshell"): { + [QGVAR(playCookoffSound), [_vehicle, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.15) then { [_vehicle, _ammo, _speed, true] call _spawnProjectile; }; }; - if (toLower _simType == "shotgrenade") then { + case ("shotgrenade"): { if (random 1 < 0.9) then { _speed = 0; }; [_vehicle, _ammo, _speed, random 1 < 0.5] call _spawnProjectile; }; - if (toLower _simType in ["shotrocket", "shotmissile", "shotsubmunitions"]) then { + case ("shotrocket"); + case ("shotmissile"); + case ("shotsubmunitions"): { if (random 1 < 0.1) then { - private _sound = selectRandom [QUOTE(PATHTO_R(sounds\cannon_crack_close.wss)), QUOTE(PATHTO_R(sounds\cannon_crack_close_filtered.wss))]; - playSound3D [_sound, objNull, false, (getPosASL _vehicle), 3, 1, 1600]; - + [QGVAR(playCookoffSound), [_vehicle, _simType]] call CBA_fnc_globalEvent; [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; } else { createvehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; }; }; - if (toLower _simType in ["shotdirectionalbomb", "shotmine"]) then { + case ("shotmine"); + case ("shotdirectionalbomb"): { if (random 1 < 0.5) then { // Not all explosives detonate on destruction, some have scripted alternatives private _scripted = getNumber (_ammoCfg >> "triggerWhenDestroyed") == 1; if !(_scripted) then { _ammo = getText (_ammoCfg >> "ace_explosives_Explosive"); }; - // If a scripted alternative doesn't exist use generic explosion if (_ammo != "") then { [_vehicle, _ammo, 0, false] call _spawnProjectile; @@ -124,12 +123,10 @@ if (_amountOfMagazines > 0) exitWith { }; }; }; - if (toLower _simType == "shotilluminating") then { + case ("shotilluminating"): { if (random 1 < 0.15) then { [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; }; }; - - [FUNC(detonateAmmunition), [_vehicle, _magazines, _totalAmmo], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute; }; -ERROR_1("mag with no ammo - %1", _magazine); +[FUNC(detonateAmmunition), [_vehicle, _magazines, _totalAmmo], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_handleDamageBox.sqf b/addons/cookoff/functions/fnc_handleDamageBox.sqf index dfc5cb7267..9368cd3193 100644 --- a/addons/cookoff/functions/fnc_handleDamageBox.sqf +++ b/addons/cookoff/functions/fnc_handleDamageBox.sqf @@ -27,7 +27,7 @@ if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [0, false]) exitWith { private _hitpoint = "#structural"; if (_hitIndex != -1) then { - _hitpoint = toLower ((getAllHitPointsDamage _vehicle param [0, []]) select _hitIndex); + _hitpoint = toLowerANSI ((getAllHitPointsDamage _vehicle param [0, []]) select _hitIndex); }; // get change in damage diff --git a/addons/cookoff/script_component.hpp b/addons/cookoff/script_component.hpp index 03b3e5c5f5..d41b8f675c 100644 --- a/addons/cookoff/script_component.hpp +++ b/addons/cookoff/script_component.hpp @@ -37,3 +37,6 @@ // Common commander hatch defines for default vehicles #define DEFAULT_COMMANDER_HATCHES ["osa_poklop_commander", "hatch_commander_axis"] + +#define DISTANCE_CLOSE 235 +#define DISTANCE_MID 952 diff --git a/addons/cookoff/sounds/cannon_crack_close.wss b/addons/cookoff/sounds/cannon_crack_close.wss deleted file mode 100644 index b45ea96ab0..0000000000 Binary files a/addons/cookoff/sounds/cannon_crack_close.wss and /dev/null differ diff --git a/addons/cookoff/sounds/cannon_crack_close_filtered.wss b/addons/cookoff/sounds/cannon_crack_close_filtered.wss deleted file mode 100644 index 4ddb18539b..0000000000 Binary files a/addons/cookoff/sounds/cannon_crack_close_filtered.wss and /dev/null differ diff --git a/addons/cookoff/sounds/heavy_crack_close.wss b/addons/cookoff/sounds/heavy_crack_close.wss deleted file mode 100644 index 95cc68d90e..0000000000 Binary files a/addons/cookoff/sounds/heavy_crack_close.wss and /dev/null differ diff --git a/addons/cookoff/sounds/heavy_crack_close_filtered.wss b/addons/cookoff/sounds/heavy_crack_close_filtered.wss deleted file mode 100644 index 1b4520cd4a..0000000000 Binary files a/addons/cookoff/sounds/heavy_crack_close_filtered.wss and /dev/null differ diff --git a/addons/cookoff/sounds/light_crack_close.wss b/addons/cookoff/sounds/light_crack_close.wss deleted file mode 100644 index ef284f24ef..0000000000 Binary files a/addons/cookoff/sounds/light_crack_close.wss and /dev/null differ diff --git a/addons/cookoff/sounds/light_crack_close_filtered.wss b/addons/cookoff/sounds/light_crack_close_filtered.wss deleted file mode 100644 index b1c76fa8ed..0000000000 Binary files a/addons/cookoff/sounds/light_crack_close_filtered.wss and /dev/null differ diff --git a/addons/cookoff/sounds/shotbullet/close_1.wss b/addons/cookoff/sounds/shotbullet/close_1.wss new file mode 100644 index 0000000000..19f07503bf Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/close_1.wss differ diff --git a/addons/cookoff/sounds/shotbullet/close_2.wss b/addons/cookoff/sounds/shotbullet/close_2.wss new file mode 100644 index 0000000000..bf83c29599 Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/close_2.wss differ diff --git a/addons/cookoff/sounds/shotbullet/close_3.wss b/addons/cookoff/sounds/shotbullet/close_3.wss new file mode 100644 index 0000000000..dcf4198acd Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/close_3.wss differ diff --git a/addons/cookoff/sounds/shotbullet/far_1.wss b/addons/cookoff/sounds/shotbullet/far_1.wss new file mode 100644 index 0000000000..07cd30e15b Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/far_1.wss differ diff --git a/addons/cookoff/sounds/shotbullet/far_2.wss b/addons/cookoff/sounds/shotbullet/far_2.wss new file mode 100644 index 0000000000..795581517a Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/far_2.wss differ diff --git a/addons/cookoff/sounds/shotbullet/far_3.wss b/addons/cookoff/sounds/shotbullet/far_3.wss new file mode 100644 index 0000000000..d7e5538150 Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/far_3.wss differ diff --git a/addons/cookoff/sounds/shotbullet/mid_1.wss b/addons/cookoff/sounds/shotbullet/mid_1.wss new file mode 100644 index 0000000000..b02a481b42 Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/mid_1.wss differ diff --git a/addons/cookoff/sounds/shotbullet/mid_2.wss b/addons/cookoff/sounds/shotbullet/mid_2.wss new file mode 100644 index 0000000000..1e184cc1ef Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/mid_2.wss differ diff --git a/addons/cookoff/sounds/shotbullet/mid_3.wss b/addons/cookoff/sounds/shotbullet/mid_3.wss new file mode 100644 index 0000000000..10606bf138 Binary files /dev/null and b/addons/cookoff/sounds/shotbullet/mid_3.wss differ diff --git a/addons/cookoff/sounds/shotrocket/close_1.wss b/addons/cookoff/sounds/shotrocket/close_1.wss new file mode 100644 index 0000000000..31ff1cbe38 Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/close_1.wss differ diff --git a/addons/cookoff/sounds/shotrocket/close_2.wss b/addons/cookoff/sounds/shotrocket/close_2.wss new file mode 100644 index 0000000000..8ef09dcf04 Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/close_2.wss differ diff --git a/addons/cookoff/sounds/shotrocket/close_3.wss b/addons/cookoff/sounds/shotrocket/close_3.wss new file mode 100644 index 0000000000..5410c359e4 Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/close_3.wss differ diff --git a/addons/cookoff/sounds/shotrocket/far_1.wss b/addons/cookoff/sounds/shotrocket/far_1.wss new file mode 100644 index 0000000000..e71990476b Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/far_1.wss differ diff --git a/addons/cookoff/sounds/shotrocket/far_2.wss b/addons/cookoff/sounds/shotrocket/far_2.wss new file mode 100644 index 0000000000..bae24fa78e Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/far_2.wss differ diff --git a/addons/cookoff/sounds/shotrocket/far_3.wss b/addons/cookoff/sounds/shotrocket/far_3.wss new file mode 100644 index 0000000000..093e841277 Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/far_3.wss differ diff --git a/addons/cookoff/sounds/shotrocket/mid_1.wss b/addons/cookoff/sounds/shotrocket/mid_1.wss new file mode 100644 index 0000000000..f927d7f174 Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/mid_1.wss differ diff --git a/addons/cookoff/sounds/shotrocket/mid_2.wss b/addons/cookoff/sounds/shotrocket/mid_2.wss new file mode 100644 index 0000000000..785dd5b603 Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/mid_2.wss differ diff --git a/addons/cookoff/sounds/shotrocket/mid_3.wss b/addons/cookoff/sounds/shotrocket/mid_3.wss new file mode 100644 index 0000000000..7fb384421d Binary files /dev/null and b/addons/cookoff/sounds/shotrocket/mid_3.wss differ diff --git a/addons/cookoff/sounds/shotshell/close_1.wss b/addons/cookoff/sounds/shotshell/close_1.wss new file mode 100644 index 0000000000..aa9a0bc718 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/close_1.wss differ diff --git a/addons/cookoff/sounds/shotshell/close_2.wss b/addons/cookoff/sounds/shotshell/close_2.wss new file mode 100644 index 0000000000..355d061d01 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/close_2.wss differ diff --git a/addons/cookoff/sounds/shotshell/close_3.wss b/addons/cookoff/sounds/shotshell/close_3.wss new file mode 100644 index 0000000000..3847fa870f Binary files /dev/null and b/addons/cookoff/sounds/shotshell/close_3.wss differ diff --git a/addons/cookoff/sounds/shotshell/far_1.wss b/addons/cookoff/sounds/shotshell/far_1.wss new file mode 100644 index 0000000000..262b037c12 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/far_1.wss differ diff --git a/addons/cookoff/sounds/shotshell/far_2.wss b/addons/cookoff/sounds/shotshell/far_2.wss new file mode 100644 index 0000000000..38e0e1eb81 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/far_2.wss differ diff --git a/addons/cookoff/sounds/shotshell/far_3.wss b/addons/cookoff/sounds/shotshell/far_3.wss new file mode 100644 index 0000000000..781f86e4b8 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/far_3.wss differ diff --git a/addons/cookoff/sounds/shotshell/mid_1.wss b/addons/cookoff/sounds/shotshell/mid_1.wss new file mode 100644 index 0000000000..76c68cdee1 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/mid_1.wss differ diff --git a/addons/cookoff/sounds/shotshell/mid_2.wss b/addons/cookoff/sounds/shotshell/mid_2.wss new file mode 100644 index 0000000000..f84b579bc4 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/mid_2.wss differ diff --git a/addons/cookoff/sounds/shotshell/mid_3.wss b/addons/cookoff/sounds/shotshell/mid_3.wss new file mode 100644 index 0000000000..990a583a04 Binary files /dev/null and b/addons/cookoff/sounds/shotshell/mid_3.wss differ diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 76aebcad60..5f764a24b7 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -188,6 +188,7 @@ 쿡오프 후 차량이 항상 파괴되는지 여부를 조정합니다. Contrôle si les véhicules seront toujours détruits après l'auto-inflammation. Define se os veículos serão sempre destruídos após cozinhamento. + Определяет, всегда ли транспортные средства будут уничтожаться после детонации. Enable Cook-Off Vehicle Fire diff --git a/addons/csw/Cfg3den.hpp b/addons/csw/Cfg3den.hpp deleted file mode 100644 index 5d15e19d6b..0000000000 --- a/addons/csw/Cfg3den.hpp +++ /dev/null @@ -1,43 +0,0 @@ -class ctrlCombo; -class Cfg3DEN { - class Attributes { - class Default; - class Title: Default { - class Controls { - class Title; - }; - }; - class Combo: Title { - class Controls: Controls { - class Title: Title {}; - class Value; - }; - }; - class GVAR(assemblyModeControl): Combo { - class Controls: Controls { - class Title: Title {}; - class Value: Value { - class Items { - class Disable { - text = "$STR_DISABLED"; - value = 0; - }; - class Enable { - text = "$STR_CONFIG_JOYSTICK_ENABLED"; - value = 1; - }; - class EnableAndEmpty { - text = CSTRING(eden_enableAndEmpty); - value = 2; - }; - class Default { - text = "$STR_VEHICLE_DEFAULT"; - value = 3; - default = 1; - }; - }; - }; - }; - }; - }; -}; diff --git a/addons/csw/CfgVehicles.hpp b/addons/csw/CfgVehicles.hpp index dd5537f645..724d5ed513 100644 --- a/addons/csw/CfgVehicles.hpp +++ b/addons/csw/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class ACE_SelfActions { class GVAR(deploy) { displayName = CSTRING(PlaceTripod_displayName); - condition = QUOTE(call FUNC(assemble_canDeployTripod)); + condition = QUOTE(call FUNC(canDeployTripod)); statement = QUOTE(call FUNC(assemble_deployTripod)); exceptions[] = {}; }; @@ -36,7 +36,7 @@ class CfgVehicles { condition = "true"; class GVAR(pickUp) { displayName = CSTRING(Pickup_displayName); - condition = QUOTE(call FUNC(assemble_canPickupTripod)); + condition = QUOTE(call FUNC(canPickupTripod)); statement = QUOTE(call FUNC(assemble_pickupTripod)); }; class GVAR(mountWeapon) { @@ -125,10 +125,11 @@ class CfgVehicles { class StaticWeapon: LandVehicle { class ACE_Actions { class ACE_MainActions { + // Workaround for static weapons' Get In memory point being at the front of the gun class GVAR(getIn) { displayName = CSTRING(GetIn_displayName); condition = QUOTE(call FUNC(canGetIn)); - statement = QUOTE(call FUNC(getIn)); + statement = QUOTE(_player moveInTurret [ARR_2(_target,[0])]); }; }; }; @@ -137,7 +138,6 @@ class CfgVehicles { class StaticMGWeapon: StaticWeapon {}; class HMG_01_base_F: StaticMGWeapon { - // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(HMG_Static); @@ -197,7 +197,6 @@ class CfgVehicles { class GMG_TriPod; class GMG_01_base_F: GMG_TriPod { - // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(GMG_20mm); // Weapon Proxy (Shorter Reload Time) [CfgWeapons] @@ -231,7 +230,6 @@ class CfgVehicles { class AT_01_base_F: StaticMGWeapon { - // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(Titan_AT_Static); @@ -245,7 +243,6 @@ class CfgVehicles { }; class AA_01_base_F: StaticMGWeapon { - // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; proxyWeapon = QGVAR(Titan_AA_Static); // Weapon Proxy (Shorter Reload Time) [CfgWeapons] @@ -261,7 +258,6 @@ class CfgVehicles { class StaticMortar: StaticWeapon {}; class Mortar_01_base_F: StaticMortar { - // ENABLE_CSW_ATTRIBUTE; class ADDON { enabled = 1; magazineLocation = ""; diff --git a/addons/csw/XEH_PREP.hpp b/addons/csw/XEH_PREP.hpp index 5966578aca..fed4120c86 100644 --- a/addons/csw/XEH_PREP.hpp +++ b/addons/csw/XEH_PREP.hpp @@ -6,9 +6,9 @@ PREP(ai_handleFired); PREP(ai_handleGetIn); PREP(ai_reload); -PREP(assemble_canDeployTripod); +PREP(canDeployTripod); PREP(assemble_canDeployWeapon); -PREP(assemble_canPickupTripod); +PREP(canPickupTripod); PREP(assemble_canPickupWeapon); PREP(assemble_deployTripod); PREP(assemble_deployWeapon); @@ -17,13 +17,12 @@ PREP(assemble_pickupTripod); PREP(assemble_pickupWeapon); PREP(canGetIn); -PREP(getIn); PREP(getCarryMagazine); PREP(proxyWeapon); -PREP(reload_actionsLoad); -PREP(reload_actionsUnload); +PREP(getLoadActions); +PREP(getUnloadActions); PREP(reload_canLoadMagazine); PREP(reload_canUnloadMagazine); PREP(reload_getLoadableMagazines); @@ -33,5 +32,5 @@ PREP(reload_handleRemoveTurretMag); PREP(reload_handleReturnAmmo); PREP(reload_loadMagazine); -PREP(staticWeaponInit); +PREP(initVehicle); PREP(staticWeaponInit_unloadExtraMags); diff --git a/addons/csw/XEH_postInit.sqf b/addons/csw/XEH_postInit.sqf index 8a0f92ce47..87196f3377 100644 --- a/addons/csw/XEH_postInit.sqf +++ b/addons/csw/XEH_postInit.sqf @@ -6,18 +6,27 @@ GVAR(vehicleMagCache) = createHashMap; TRACE_3("settingsInit",GVAR(defaultAssemblyMode),GVAR(handleExtraMagazines),GVAR(ammoHandling)); ["StaticWeapon", "Init", { // needs a small delay for network syncing, or we end up with duplicate mags with ammo handling - [LINKFUNC(staticWeaponInit), _this, 1] call CBA_fnc_waitAndExecute; + [LINKFUNC(initVehicle), _this, 1] call CBA_fnc_waitAndExecute; }, true, [], true] call CBA_fnc_addClassEventHandler; + + GVAR(quickmountEnabled) = ( + missionNamespace getVariable [QEGVAR(quickmount,enabled), false] && + {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]} + ); }] call CBA_fnc_addEventHandler; +["CBA_SettingChanged", { + GVAR(quickmountEnabled) = ( + missionNamespace getVariable [QEGVAR(quickmount,enabled), false] && + {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]} + ); +}] call CBA_fnc_addEventHandler; // Event handlers: [QGVAR(addTurretMag), LINKFUNC(reload_handleAddTurretMag)] call CBA_fnc_addEventHandler; [QGVAR(removeTurretMag), LINKFUNC(reload_handleRemoveTurretMag)] call CBA_fnc_addEventHandler; [QGVAR(returnAmmo), LINKFUNC(reload_handleReturnAmmo)] call CBA_fnc_addEventHandler; - - #ifdef DEBUG_MODE_FULL call compile preprocessFileLineNumbers QPATHTOF(dev\checkStaticWeapons.sqf); #endif diff --git a/addons/csw/config.cpp b/addons/csw/config.cpp index 98abcea5c0..aab2b0416f 100644 --- a/addons/csw/config.cpp +++ b/addons/csw/config.cpp @@ -15,7 +15,6 @@ class CfgPatches { }; }; -#include "Cfg3den.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/csw/dev/checkStaticWeapons.sqf b/addons/csw/dev/checkStaticWeapons.sqf index 59e712cb70..7d9917daa7 100644 --- a/addons/csw/dev/checkStaticWeapons.sqf +++ b/addons/csw/dev/checkStaticWeapons.sqf @@ -7,14 +7,14 @@ INFO("Checking static weapons"); private _staticWeaponConfigs = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(configName _x) isKindOf 'StaticWeapon'}", true]; private _staticPublic = _staticWeaponConfigs select {(getNumber (_x >> "scope")) == 2}; -INFO_2("Static Weapons [%1] - CSW Enabled [%2]",count _staticPublic, {(getNumber (_x >> "ace_csw" >> "enabled")) == 1} count _staticPublic); +INFO_2("Static Weapons [%1] - CSW Enabled [%2]",count _staticPublic,{(getNumber (_x >> QUOTE(ADDON) >> "enabled")) == 1} count _staticPublic); INFO("------ Checking static weapons inheritance ------"); private _explicitBases = []; private _inherited = []; { private _config = _x; - private _configEnabled = (getNumber (_config >> "ace_csw" >> "enabled")) == 1; + private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1; if (_configEnabled) then { private _configExplicit = (count configProperties [_config, "configName _x == 'ace_csw'", false]) == 1; if (_configExplicit) then { @@ -69,7 +69,7 @@ private _logAll = false; { //IGNORE_PRIVATE_WARNING ["_x", "_y"]; - INFO_2("[%1] has no carry varient - Used in %2",_x,_y); + INFO_2("[%1] has no carry variant - Used in %2",_x,_y); } forEach _hash; INFO("------ End -------"); diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index e6d76f13dc..d92e517091 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -12,12 +12,12 @@ * Public: No */ -params ["_staticWeapon", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; -TRACE_8("firedEH:",_staticWeapon,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner); +params ["_vehicle", "_weapon", "", "", "", "_magazine", "", "_gunner"]; +TRACE_4("firedEH:",_vehicle,_weapon,_magazine,_gunner); +if (someAmmo _vehicle) exitWith {}; if ((!local _gunner) || {[_gunner] call EFUNC(common,isPlayer)}) exitWith {}; -if (someAmmo _staticWeapon) exitWith {}; -TRACE_2("need ammo",someAmmo _staticWeapon,magazinesAllTurrets _staticWeapon); +TRACE_1("need ammo",magazinesAllTurrets _vehicle); -[_staticWeapon, _gunner, _weapon, _magazine] call FUNC(ai_reload); +[_vehicle, _gunner, _weapon, _magazine] call FUNC(ai_reload); diff --git a/addons/csw/functions/fnc_ai_handleGetIn.sqf b/addons/csw/functions/fnc_ai_handleGetIn.sqf index 26a94b58e3..f14a4ccbc7 100644 --- a/addons/csw/functions/fnc_ai_handleGetIn.sqf +++ b/addons/csw/functions/fnc_ai_handleGetIn.sqf @@ -11,12 +11,13 @@ * * Public: No */ -params ["_staticWeapon", "_role", "_gunner"]; -TRACE_3("getInEH:",_staticWeapon,_role,_gunner); +params ["_vehicle", "", "_gunner"]; +TRACE_2("getInEH:",_vehicle,_gunner); + +if (someAmmo _vehicle) exitWith {}; if ((!local _gunner) || {[_gunner] call EFUNC(common,isPlayer)}) exitWith {}; -if (someAmmo _staticWeapon) exitWith {}; -TRACE_2("need ammo",someAmmo _staticWeapon,magazinesAllTurrets _staticWeapon); +TRACE_1("need ammo",magazinesAllTurrets _vehicle); -[_staticWeapon, _gunner, currentWeapon _staticWeapon] call FUNC(ai_reload); +[_vehicle, _gunner, currentWeapon _vehicle] call FUNC(ai_reload); diff --git a/addons/csw/functions/fnc_ai_reload.sqf b/addons/csw/functions/fnc_ai_reload.sqf index 31d41b0588..4d6234f94a 100644 --- a/addons/csw/functions/fnc_ai_reload.sqf +++ b/addons/csw/functions/fnc_ai_reload.sqf @@ -14,6 +14,7 @@ * * Public: No */ + params ["_staticWeapon", "_gunner", "_weapon", ["_magazine", ""]]; private _turretPath = [_gunner] call EFUNC(common,getTurretIndex); @@ -39,7 +40,7 @@ private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { } forEach ((magazineCargo _xSource) select {isClass (_cfgMagGroups >> _x)}); TRACE_2("",_xSource,_cswMagazines); - private _compatibleMags = [_weapon] call CBA_fnc_compatibleMagazines; + private _compatibleMags = compatibleMagazines _weapon; if (_magazine != "") then { _compatibleMags insert [0, [_magazine]]; }; diff --git a/addons/csw/functions/fnc_assemble_canDeployTripod.sqf b/addons/csw/functions/fnc_assemble_canDeployTripod.sqf deleted file mode 100644 index 82412b5556..0000000000 --- a/addons/csw/functions/fnc_assemble_canDeployTripod.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author:tcvm - * Checks if the player can deploy the tripod. - * - * Arguments: - * 0: Unit - * - * Return Value: - * Can deploy - * - * Example: - * [player] call ace_csw_fnc_assemble_canDeployTripod - * - * Public: No - */ - -params ["_player"]; - -(getText(configFile >> "CfgWeapons" >> (secondaryWeapon _player) >> QUOTE(ADDON) >> "type") == "mount") - diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 897ee6acd0..57f2ce2bc8 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * Checks if you can deploy a weapon on the tripod * * Arguments: @@ -22,4 +22,3 @@ if (isNil "_carryWeaponClassname") then { _carryWeaponClassname = secondaryWeapo // If the current launcher has a config-value that defines the tripod, it is a CSW (alive _target) && {(getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))) != ""} - diff --git a/addons/csw/functions/fnc_assemble_canPickupTripod.sqf b/addons/csw/functions/fnc_assemble_canPickupTripod.sqf deleted file mode 100644 index 8a7656db83..0000000000 --- a/addons/csw/functions/fnc_assemble_canPickupTripod.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author:tcvm - * Checks if the player can pick-up the tripod. - * - * Arguments: - * 0: Tripod - * 1: Unit - * - * Return Value: - * Can pickup - * - * Example: - * [tripod, player] call ace_csw_fnc_assemble_canPickupTripod - * - * Public: No - */ - -params ["_tripod", "_player"]; - -((secondaryWeapon _player) isEqualTo "") && {alive _tripod} - diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 9665311d9d..6217d769dd 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * If the CSW is mounted or in use this will not allow you to dismount the weapon * * Arguments: @@ -22,5 +22,4 @@ private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_ private _notCrewed = (crew _staticWeapon) isEqualTo []; private _deadCrew = !(alive (gunner _staticWeapon)); // need to eject body??? -_assemblyMode && {_notCrewed || _deadCrew} - +_assemblyMode && {alive _staticWeapon} && {_notCrewed || _deadCrew} diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index d3317a4e40..da2ed56c04 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * Deploys the tripod * * Arguments: @@ -23,7 +23,7 @@ private _secondaryWeaponClassname = secondaryWeapon _player; // handle loaded launchers which can become csw like CUP Metis private _secondaryWeaponMagazine = secondaryWeaponMagazine _player param [0, ""]; - _player removeWeaponGlobal (secondaryWeapon _player); + _player removeWeaponGlobal _secondaryWeaponClassname; private _onFinish = { params ["_args"]; @@ -40,7 +40,7 @@ _cswTripod setVariable [QGVAR(secondaryWeaponMagazine), _secondaryWeaponMagazine]; }; if (!GVAR(defaultAssemblyMode)) then { - [_cswTripod, "disableWeaponAssembly", "ace_csw", true] call EFUNC(common,statusEffect_set); + [_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); }; private _posATL = _player getRelPos [2, 0]; @@ -75,5 +75,5 @@ }; private _deployTime = getNumber(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); - [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponMagazine], _onFinish, _onFailure, localize LSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponMagazine], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index e34e5d19d8..b9f8029bc2 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * Deploys the current CSW * * Arguments: @@ -23,10 +23,13 @@ private _tripodClassname = typeOf _tripod; _player removeWeaponGlobal _carryWeaponClassname; - private _assembledClassname = getText(configfile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> _tripodClassname); - private _deployTime = getNumber(configfile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); + private _weaponConfig = configfile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON); + private _assembledClassname = getText (_weaponConfig >> "assembleTo" >> _tripodClassname); + if (!isClass (configFile >> "CfgVehicles" >> _assembledClassname)) exitWith {ERROR_1("bad static classname [%1]",_assembledClassname);}; + private _deployTime = getNumber (_weaponConfig >> "deployTime"); + TRACE_4("",_carryWeaponClassname,_tripodClassname,_assembledClassname,_deployTime); private _onFinish = { @@ -69,8 +72,9 @@ private _codeCheck = { params ["_args"]; _args params ["_tripod"]; - !isNull _tripod; + + alive _tripod }; - [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname], _onFinish, _onFailure, localize LSTRING(AssembleCSW_progressBar), _codeCheck] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _codeCheck] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_pickupTripod.sqf b/addons/csw/functions/fnc_assemble_pickupTripod.sqf index 449a445dc2..176718f015 100644 --- a/addons/csw/functions/fnc_assemble_pickupTripod.sqf +++ b/addons/csw/functions/fnc_assemble_pickupTripod.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * Picks up the tripod and adds it to the player launcher slot * * Arguments: @@ -20,8 +20,8 @@ params ["_tripod", "_player"]; TRACE_2("assemble_pickupTripod",_tripod,_player); - private _tripodClassname = getText(configOf _tripod >> QUOTE(ADDON) >> "disassembleTo"); - private _pickupTime = getNumber(configFile >> "CfgWeapons" >> _tripodClassname >> QUOTE(ADDON) >> "pickupTime"); + private _tripodClassname = getText (configOf _tripod >> QUOTE(ADDON) >> "disassembleTo"); + private _pickupTime = getNumber (configFile >> "CfgWeapons" >> _tripodClassname >> QUOTE(ADDON) >> "pickupTime"); private _onFinish = { params ["_args"]; @@ -37,11 +37,9 @@ params ["_args"]; _args params ["_tripod", "_player"]; - !(isNull _tripod) && { (secondaryWeapon _player) isEqualTo "" } - + (alive _tripod) && {secondaryWeapon _player == ""} }; TRACE_3("",_pickupTime,typeOf _tripod,_tripodClassname); - [TIME_PROGRESSBAR(_pickupTime), [_tripod, _player, _tripodClassname], _onFinish, {}, localize LSTRING(PickupTripod_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_pickupTime), [_tripod, _player, _tripodClassname], _onFinish, {}, LLSTRING(PickupTripod_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; - diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 99d0229566..3034e2260c 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * Dismounts the weapon from the tripod and drops its backpack beside * * Arguments: @@ -19,14 +19,24 @@ params ["_staticWeapon", "_player"]; TRACE_2("assemble_pickupWeapon",_staticWeapon,_player); - private _onDisassembleFunc = getText(configOf _staticWeapon >> QUOTE(ADDON) >> "disassembleFunc"); - private _carryWeaponClassname = getText(configOf _staticWeapon >> QUOTE(ADDON) >> "disassembleWeapon"); - private _turretClassname = getText(configOf _staticWeapon >> QUOTE(ADDON) >> "disassembleTurret"); - private _pickupTime = getNumber(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime"); - TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime); - if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith {ERROR_1("bad weapon classname [%1]",_carryWeaponClassname);}; + private _weaponConfig = configOf _staticWeapon >> QUOTE(ADDON); + private _carryWeaponClassname = getText (_weaponConfig >> "disassembleWeapon"); + + if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith { + ERROR_1("bad weapon classname [%1]",_carryWeaponClassname); + }; + + private _turretClassname = getText (_weaponConfig >> "disassembleTurret"); + // Turret classname can equal nothing if the deploy bag is the "whole" weapon. e.g Kornet, Metis, other ATGMs - if ((_turretClassname isNotEqualTo "") && {!isClass (configFile >> "CfgVehicles" >> _turretClassname)}) exitWith {ERROR_1("bad turret classname [%1]",_turretClassname);}; + if ((_turretClassname != "") && {!isClass (configFile >> "CfgVehicles" >> _turretClassname)}) exitWith { + ERROR_1("bad turret classname [%1]",_turretClassname); + }; + + private _onDisassembleFunc = getText (_weaponConfig >> "disassembleFunc"); + + private _pickupTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime"); + TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime); private _onFinish = { params ["_args"]; @@ -38,14 +48,14 @@ private _weaponDir = getDir _staticWeapon; private _carryWeaponMag = ""; - private _carryWeaponMags = getArray (configFile >> "CfgWeapons" >> _carryWeaponClassname >> "magazines") apply {toLower _x}; + private _carryWeaponMags = compatibleMagazines _carryWeaponClassname; LOG("remove ammo"); { _x params ["_xMag", "", "_xAmmo"]; if (_xAmmo == 0) then {continue}; private _carryMag = _xMag call FUNC(getCarryMagazine); - if (_carryWeaponMag isEqualTo "" && {toLower _carryMag in _carryWeaponMags}) then { + if (_carryWeaponMag == "" && {_carryMag in _carryWeaponMags}) then { TRACE_3("Adding mag to secondary weapon",_xMag,_xAmmo,_carryMag); _carryWeaponMag = _carryMag; DEC(_xAmmo); @@ -100,5 +110,5 @@ ((crew _staticWeapon) isEqualTo []) && (alive _staticWeapon) }; - [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, localize LSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_canDeployTripod.sqf b/addons/csw/functions/fnc_canDeployTripod.sqf new file mode 100644 index 0000000000..8969758e4d --- /dev/null +++ b/addons/csw/functions/fnc_canDeployTripod.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Checks if the unit can deploy a tripod + * + * Arguments: + * 0: Unit + * + * Return Value: + * Can deploy + * + * Example: + * player call ace_csw_fnc_canDeployTripod + * + * Public: No + */ + +params ["_unit"]; + +private _secondaryWeapon = secondaryWeapon _unit; + +_secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return diff --git a/addons/csw/functions/fnc_canGetIn.sqf b/addons/csw/functions/fnc_canGetIn.sqf index 16ffe29a77..16446c4fb2 100644 --- a/addons/csw/functions/fnc_canGetIn.sqf +++ b/addons/csw/functions/fnc_canGetIn.sqf @@ -1,28 +1,23 @@ #include "..\script_component.hpp" /* - * Author:tcvm - * Checks if the player can get in the weapon + * Author: tcvm + * Checks if it's possible to get in the CSW * * Arguments: - * 0: Static Weapon + * 0: Vehicle * * Return Value: * None * * Example: - * [cursorObject] call ace_csw_fnc_canGetIn + * cursorObject call ace_csw_fnc_canGetIn * * Public: No */ -// hide this action if quick mount is enabled -if ((missionNamespace getVariable [QEGVAR(quickmount,enabled), false]) && {(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1, 3]}) exitWith { - false -}; +// Hide this action if quick mount is enabled +if (GVAR(quickmountEnabled)) exitWith {false}; -params ["_staticWeapon"]; +params ["_vehicle"]; -alive _staticWeapon -&& {!(alive (gunner _staticWeapon))} -&& {(locked _staticWeapon) < 2} -&& {0.3 < ((vectorUp _staticWeapon) select 2)} +alive _vehicle && {!(alive (gunner _vehicle))} && {(locked _vehicle) < 2} && {!(_vehicle lockedTurret [0])} && {0.3 < ((vectorUp _vehicle) select 2)} // return diff --git a/addons/csw/functions/fnc_canPickupTripod.sqf b/addons/csw/functions/fnc_canPickupTripod.sqf new file mode 100644 index 0000000000..0a9f0f5f90 --- /dev/null +++ b/addons/csw/functions/fnc_canPickupTripod.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Checks if the unit can pickup the tripod + * + * Arguments: + * 0: Tripod + * 1: Unit + * + * Return Value: + * Can pickup + * + * Example: + * [cursorObject, player] call ace_csw_fnc_canPickupTripod + * + * Public: No + */ + +params ["_tripod", "_unit"]; + +((secondaryWeapon _unit) == "") && {alive _tripod} // return diff --git a/addons/csw/functions/fnc_getIn.sqf b/addons/csw/functions/fnc_getIn.sqf deleted file mode 100644 index 61ca962d06..0000000000 --- a/addons/csw/functions/fnc_getIn.sqf +++ /dev/null @@ -1,24 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author:tcvm - * An action for the player to get in the CSW - * Due to the fact that the default static weapons "Get In" memory point is at the front of - * the gun and can't be acssesed from the back, I am implementing this to get around that issue. - * - * Arguments: - * 0: Static Weapon - * 1: Unit - * - * Return Value: - * None - * - * Example: - * [cursorObject, player] call ace_csw_fnc_getIn - * - * Public: No - */ - -params ["_staticWeapon", "_player"]; -TRACE_2("getIn",_staticWeapon,_player); - -_player moveInTurret [_staticWeapon, [0]]; diff --git a/addons/csw/functions/fnc_reload_actionsLoad.sqf b/addons/csw/functions/fnc_getLoadActions.sqf similarity index 62% rename from addons/csw/functions/fnc_reload_actionsLoad.sqf rename to addons/csw/functions/fnc_getLoadActions.sqf index 557811d440..e505c7f50f 100644 --- a/addons/csw/functions/fnc_reload_actionsLoad.sqf +++ b/addons/csw/functions/fnc_getLoadActions.sqf @@ -1,42 +1,42 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets sub actions for what the player can load into the static weapon + * Gets sub actions for what the unit can load into the CSW * * Arguments: - * 0: Static Weapon - * 1: Player + * 0: Vehicle + * 1: Unit * * Return Value: * Actions * * Example: - * [cursorObject, player] call ace_csw_fnc_reload_actionsLoad + * [cursorObject, player] call ace_csw_fnc_getLoadActions * * Public: No */ -params ["_vehicle", "_player"]; +params ["_vehicle", "_unit"]; -private _actions = []; -private _loadableMagazines = [_vehicle, _player] call FUNC(reload_getLoadableMagazines); +private _loadableMagazines = [_vehicle, _unit] call FUNC(reload_getLoadableMagazines); +if (_loadableMagazines isEqualTo []) exitWith {[]}; private _statement = { - params ["_target", "_player", "_params"]; - _params params ["_carryMag", "_turretPath", "", "_magSource"]; + params ["_target", "_player", "_args"]; + _args params ["_carryMag", "_turretPath", "", "_magSource"]; [_target, _turretPath, _carryMag, _magSource, _player] call FUNC(reload_loadMagazine); }; private _condition = { - params ["_target", "_player", "_params"]; - _params params ["_carryMag", "_turretPath", "", "_magSource"]; + params ["_target", "_player", "_args"]; + _args params ["_carryMag", "_turretPath", "", "_magSource"]; ([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0 }; private _cfgMagazines = configFile >> "CfgMagazines"; // micro-optimization - +private _actions = []; { _x params ["_carryMag", "", "_loadInfo"]; _loadInfo params ["", "", "", "_isBeltLinking"]; @@ -44,9 +44,9 @@ private _cfgMagazines = configFile >> "CfgMagazines"; // micro-optimization private _displayName = getText (_cfgMagazines >> _carryMag >> "displayName"); private _picture = getText (_cfgMagazines >> _carryMag >> "picture"); private _text = if (_isBeltLinking) then { - format [localize LSTRING(actionLink), _displayName]; + format [LLSTRING(actionLink), _displayName]; } else { - format [localize LSTRING(loadX), _displayName]; + format [LLSTRING(loadX), _displayName]; }; private _action = [format ["load_%1", _forEachIndex], _text, _picture, _statement, _condition, {}, _x] call EFUNC(interact_menu,createAction); diff --git a/addons/csw/functions/fnc_getUnloadActions.sqf b/addons/csw/functions/fnc_getUnloadActions.sqf new file mode 100644 index 0000000000..dd119b0622 --- /dev/null +++ b/addons/csw/functions/fnc_getUnloadActions.sqf @@ -0,0 +1,75 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Gets sub actions for what can be unloaded from the CSW + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Actions + * + * Example: + * cursorObject call ace_csw_fnc_getUnloadActions + * + * Public: No + */ + +params ["_vehicle"]; + +private _statement = { + params ["_target", "_player", "_args"]; + _args params ["_vehMag", "_turretPath", "_carryMag"]; + TRACE_5("starting unload",_target,_turretPath,_player,_carryMag,_vehMag); + + private _timeToUnload = 1; + private _config = configOf _target >> QUOTE(ADDON) >> "ammoUnloadTime"; + if (!isNull _config) then { + _timeToUnload = getNumber _config; + }; + + [ + TIME_PROGRESSBAR(_timeToUnload), + [_target, _turretPath, _player, _carryMag, _vehMag], + { + (_this select 0) params ["_target", "_turretPath", "", "_carryMag", "_vehMag"]; + TRACE_5("unload progressBar finish",_target,_turretPath,_carryMag,_vehMag,_player); + [QGVAR(removeTurretMag), [_target, _turretPath, _carryMag, _vehMag, _player]] call CBA_fnc_globalEvent; + }, + {TRACE_1("unload progressBar fail",_this);}, + format [LLSTRING(unloadX), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")], + {(_this select 0) call FUNC(reload_canUnloadMagazine)}, + ["isNotInside"] + ] call EFUNC(common,progressBar); +}; + +private _condition = { + params ["_target", "_player", "_args"]; + _args params ["_vehMag", "_turretPath", "_carryMag"]; + [_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine) +}; + +private _actions = []; +private _handledMagTypes = []; + +private _cfgMagazines = configFile >> "CfgMagazines"; + +// Go through magazines on static weapon and check if any are unloadable +{ + _x params ["_xMag", "_xTurret", "_xAmmo"]; + + if ((_xAmmo > 0) && {!(_xMag in _handledMagTypes)}) then { + _handledMagTypes pushBack _xMag; + private _carryMag = _xMag call FUNC(getCarryMagazine); + if (_carryMag == "") exitWith {}; + + private _displayName = getText (_cfgMagazines >> _carryMag >> "displayName"); + private _text = format [LLSTRING(unloadX), _displayName]; + private _picture = getText (_cfgMagazines >> _carryMag >> "picture"); + private _action = [format ["unload_%1", _forEachIndex], _text, _picture, _statement, _condition, {}, [_xMag, _xTurret, _carryMag]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _vehicle]; + }; +} forEach (magazinesAllTurrets _vehicle); + +TRACE_1("unloadActions",count _actions); +_actions diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf new file mode 100644 index 0000000000..2d7241029f --- /dev/null +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -0,0 +1,102 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm + * Initializes CSW systems on vehicle + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_csw_fnc_initVehicle + * + * Public: No + */ + +params ["_vehicle"]; +if (!alive _vehicle) exitWith { WARNING_1("%1 not alive",_vehicle); }; +if (!simulationEnabled _vehicle) exitWith { + [{simulationEnabled _this}, FUNC(initVehicle), _vehicle] call CBA_fnc_waitUntilAndExecute; +}; + +private _typeOf = typeOf _vehicle; +private _configOf = configOf _vehicle; +private _configEnabled = (getNumber (_configOf >> QUOTE(ADDON) >> "enabled")) == 1; +private _assemblyConfig = _configEnabled && {(getText (_configOf >> QUOTE(ADDON) >> "disassembleWeapon")) != ""}; +TRACE_4("initVehicle",_vehicle,_typeOf,_configEnabled,_assemblyConfig); + +if (_configEnabled && {GVAR(ammoHandling) == 2}) then { + TRACE_1("adding AI fired handler",_vehicle); + _vehicle addEventHandler ["Fired", LINKFUNC(ai_handleFired)]; + _vehicle addEventHandler ["GetIn", LINKFUNC(ai_handleGetIn)]; // handle AI getting inside weapon with no ammo +}; + +TRACE_2("",local _vehicle,_vehicle turretLocal [0]); +if (_configEnabled && {_vehicle turretLocal [0]}) then { // if turret is local to us, then handle mags/weapon + [{ + params ["_vehicle"]; + if (!alive _vehicle) exitWith { TRACE_1("dead/deleted",_vehicle); }; + // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] + private _assemblyModeIndex = _vehicle getVariable [QGVAR(assemblyMode), 3]; + private _emptyWeapon = _assemblyModeIndex isEqualTo 2; + private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; + TRACE_2("turretLocal",_vehicle,_assemblyMode); + [_vehicle, [0], _assemblyMode, _emptyWeapon] call FUNC(proxyWeapon); + [_vehicle, _assemblyMode, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); + }, [_vehicle]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly +}; + +if (_assemblyConfig) then { + [{ + params ["_vehicle"]; + if (!alive _vehicle) exitWith { TRACE_1("dead/deleted",_vehicle); }; + private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); + TRACE_2("assemblyConfig present",_vehicle,_assemblyMode); + if (_assemblyMode) then { // Disable vanilla assembly if assemblyMode enabled + [_vehicle, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + }; + }, [_vehicle]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly +}; + +// Add interactions for players +if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { + GVAR(initializedStaticTypes) pushBack _typeOf; + TRACE_1("Adding Actions",_typeOf); + + if (_assemblyConfig) then { + private _disassembleAction = [QGVAR(disassemble), LLSTRING(DisassembleCSW_displayName), "", LINKFUNC(assemble_pickupWeapon), LINKFUNC(assemble_canPickupWeapon)] call EFUNC(interact_menu,createAction); + [_typeOf, 0, ["ACE_MainActions"], _disassembleAction] call EFUNC(interact_menu,addActionToClass); + }; + + + private _ammoActionPath = []; + private _magazineLocation = getText (_configOf >> QUOTE(ADDON) >> "magazineLocation"); + private _condition = { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + // If magazine handling is enabled or weapon assembly/disassembly is enabled we enable ammo handling + if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; + [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) + }; + private _childenCode = { + BEGIN_COUNTER(getActions); // can remove for final release + private _ret = (call FUNC(getLoadActions)) + (call FUNC(getUnloadActions)); + END_COUNTER(getActions); + _ret + }; + if (_configEnabled && {_magazineLocation != ""}) then { + private _positionCode = compile _magazineLocation; + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); + _ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass); + } else { + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction); + _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); + }; + + if (["ace_reload"] call EFUNC(common,isModLoaded)) then { + // move reload's check ammo action to the ammo handling point (remove and re-add) + [_typeOf, 0, ["ACE_MainActions", QEGVAR(reload,CheckAmmo)]] call EFUNC(interact_menu,removeActionFromClass); + private _checkAmmoAction = [QGVAR(checkAmmo), LELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction); + [_typeOf, 0, _ammoActionPath, _checkAmmoAction] call EFUNC(interact_menu,addActionToClass); + }; +}; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index 40ab4b1e4c..fedd1d412b 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles the use of proxy weapons to fix engine-reload times + * Handles the use of proxy weapons to bypass engine reload times * * Arguments: - * 0: Weapon + * 0: Vehicle * 1: Turret * 2: Proxy weapon needed * 2: Weapon should be emptied @@ -13,34 +13,34 @@ * None * * Example: - * [weapon, [0], true, false] call ace_csw_fnc_proxyWeapon + * [cursorObject, [0], true, false] call ace_csw_fnc_proxyWeapon * * Public: No */ -params ["_staticWeapon", "_turret", "_needed", "_emptyWeapon"]; -TRACE_4("proxyWeapon",_staticWeapon,_turret,_needed,_emptyWeapon); +params ["_vehicle", "_turret", "_needed", "_emptyWeapon"]; +TRACE_4("proxyWeapon",_vehicle,_turret,_needed,_emptyWeapon); -if (_staticWeapon getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exitWith { TRACE_1("already handled",typeOf _staticWeapon); }; +if (_vehicle getVariable [format [QGVAR(proxyHandled_%1), _turret], false]) exitWith { TRACE_1("already handled",typeOf _vehicle); }; -private _proxyWeapon = getText (configOf _staticWeapon >> "ace_csw" >> "proxyWeapon"); +private _proxyWeapon = getText (configOf _vehicle >> QUOTE(ADDON) >> "proxyWeapon"); -TRACE_2("",typeOf _staticWeapon,_proxyWeapon); +TRACE_2("",typeOf _vehicle,_proxyWeapon); if (_proxyWeapon == "") exitWith {}; -private _currentWeapon = (_staticWeapon weaponsTurret [0]) param [0, "#none"]; +private _currentWeapon = (_vehicle weaponsTurret [0]) param [0, "#none"]; if ((missionNamespace getVariable [_proxyWeapon, objNull]) isEqualType {}) then { // check if string is a function TRACE_1("Calling proxyWeapon function",_proxyWeapon); // This function may replace magazines or do other things to the static weapon - _proxyWeapon = [_staticWeapon, _turret, _currentWeapon, _needed, _emptyWeapon] call (missionNamespace getVariable _proxyWeapon); + _proxyWeapon = [_vehicle, _turret, _currentWeapon, _needed, _emptyWeapon] call (missionNamespace getVariable _proxyWeapon); _needed = _proxyWeapon != ""; }; if (!_needed) exitWith { TRACE_2("not needed",_needed,_proxyWeapon); }; // Rearm compatibility, prevent reloading entire static and breaking CSW -_staticWeapon setVariable [QEGVAR(rearm,scriptedLoadout), true, true]; +_vehicle setVariable [QEGVAR(rearm,scriptedLoadout), true, true]; TRACE_2("swapping to proxy weapon",_currentWeapon,_proxyWeapon); -_staticWeapon removeWeaponTurret [_currentWeapon, _turret]; -_staticWeapon addWeaponTurret [_proxyWeapon, _turret]; -_staticWeapon setVariable [format [QGVAR(proxyHandled_%1), _turret], true, true]; +_vehicle removeWeaponTurret [_currentWeapon, _turret]; +_vehicle addWeaponTurret [_proxyWeapon, _turret]; +_vehicle setVariable [format [QGVAR(proxyHandled_%1), _turret], true, true]; diff --git a/addons/csw/functions/fnc_reload_actionsUnload.sqf b/addons/csw/functions/fnc_reload_actionsUnload.sqf deleted file mode 100644 index 5ef40ace70..0000000000 --- a/addons/csw/functions/fnc_reload_actionsUnload.sqf +++ /dev/null @@ -1,75 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: PabstMirror - * Gets sub actions for what the player can unload from the static weapon - * - * Arguments: - * 0: Target - * 1: Player - * - * Return Value: - * Actions - * - * Example: - * [cursorObject, player] call ace_csw_fnc_reload_actionsUnload - * - * Public: No - */ - -params ["_vehicle", "_player"]; - -private _statement = { - params ["_target", "_player", "_params"]; - _params params ["_vehMag", "_turretPath", "_carryMag"]; - TRACE_5("starting unload",_target,_turretPath,_player,_carryMag,_vehMag); - - private _timeToUnload = 1; - if (!isNull(configOf _target >> QUOTE(ADDON) >> "ammoUnloadTime")) then { - _timeToUnload = getNumber(configOf _target >> QUOTE(ADDON) >> "ammoUnloadTime"); - }; - - [ - TIME_PROGRESSBAR(_timeToUnload), - [_target, _turretPath, _player, _carryMag, _vehMag], - { - (_this select 0) params ["_target", "_turretPath", "", "_carryMag", "_vehMag"]; - TRACE_5("unload progressBar finish",_target,_turretPath,_carryMag,_vehMag,_player); - [QGVAR(removeTurretMag), [_target, _turretPath, _carryMag, _vehMag, _player]] call CBA_fnc_globalEvent; - }, - {TRACE_1("unload progressBar fail",_this);}, - format [localize LSTRING(unloadX), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")], - {(_this select 0) call FUNC(reload_canUnloadMagazine)}, - ["isNotInside"] - ] call EFUNC(common,progressBar); -}; - -private _condition = { - params ["_target", "_player", "_params"]; - _params params ["_vehMag", "_turretPath", "_carryMag"]; - [_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine) -}; - -private _actions = []; -private _handeledMagTypes = []; - -private _cfgMagazines = configFile >> "CfgMagazines"; - -// Go through magazines on static weapon and check if any are unloadable -{ - _x params ["_xMag", "_xTurret", "_xAmmo"]; - - if ((_xAmmo > 0) && {!(_xMag in _handeledMagTypes)}) then { - _handeledMagTypes pushBack _xMag; - private _carryMag = _xMag call FUNC(getCarryMagazine); - if (_carryMag == "") exitWith {}; - - private _displayName = getText (_cfgMagazines >> _carryMag >> "displayName"); - private _text = format [LLSTRING(unloadX), _displayName]; - private _picture = getText (_cfgMagazines >> _carryMag >> "picture"); - private _action = [format ["unload_%1", _forEachIndex], _text, _picture, _statement, _condition, {}, [_xMag, _xTurret, _carryMag]] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _vehicle]; - }; -} forEach (magazinesAllTurrets _vehicle); - -TRACE_1("unloadActions",count _actions); -_actions diff --git a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf index 933625fb89..724ee4d09c 100644 --- a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf +++ b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf @@ -70,7 +70,7 @@ private _return = []; ) exitWith { _return pushBack [_carryMag, _turretPath, _loadInfo, _magSource]; }; - } forEach ([_weapon] call CBA_fnc_compatibleMagazines); + } forEach (compatibleMagazines _weapon); } forEach _availableMagazines; } forEach (_vehicle weaponsTurret _turretPath); } forEach (allTurrets _vehicle); diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index 9a2eae2bd4..e5aa51d342 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm, PabstMirror + * Author: tcvm, PabstMirror * Handles adding ammo to a turret * Called from a global event but only runs where turret is local * @@ -24,7 +24,7 @@ params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_returnTo", _magSource]]; TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo); -TRACE_2("",local _vehicle, _vehicle turretLocal _turret); +TRACE_2("",local _vehicle,_vehicle turretLocal _turret); if (!(_vehicle turretLocal _turret)) exitWith {}; ([_vehicle, _turret, _carryMag] call FUNC(reload_canLoadMagazine)) params ["_canAdd", "_loadedMag", "_neededAmmo", "_isBeltLinking"]; @@ -43,10 +43,10 @@ if (_canAdd) then { // setMagazineTurretAmmo is broken on split locality, use setAmmo for now (this may not work for multi turret vehicles) private _weapon = (_vehicle weaponsTurret _turret) param [0, ""]; - TRACE_3("setAmmo",_vehicle,_weapon, _currentAmmo); + TRACE_3("setAmmo",_vehicle,_weapon,_currentAmmo); _vehicle setAmmo [_weapon, _currentAmmo]; private _currentAmmo = _vehicle magazineTurretAmmo [_loadedMag, _turret]; - if ((_weapon == "") || {_currentAmmo != _currentAmmo}) then { ERROR_1("failed to setAmmo - %1", _this); }; + if ((_weapon == "") || {_currentAmmo != _currentAmmo}) then { ERROR_1("failed to setAmmo - %1",_this); }; } else { if (_loadedMag != "") then { TRACE_1("Removing emtpy mag",_loadedMag); diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index d53d35a0d8..59d948ba27 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author:tcvm + * Author: tcvm * Handles removing ammo from a turret * Called from a global event but only runs where turret is local * @@ -23,7 +23,7 @@ params ["_vehicle", "_turretPath", "_carryMag", "_vehMag", "_unloadTo"]; TRACE_5("removeTurretMag EH",_vehicle,_turretPath,_carryMag,_vehMag,_unloadTo); -TRACE_3("",local _vehicle, _vehicle turretLocal _turretPath,local _unloadTo); +TRACE_3("",local _vehicle,_vehicle turretLocal _turretPath,local _unloadTo); if (!(_vehicle turretLocal _turretPath)) exitWith {}; private _magsInWeapon = []; // Check how much ammo it has now: @@ -55,10 +55,10 @@ if ((_magsInWeapon isEqualTo []) && {_ammoInFirstMag > _ammoRemoved}) then { // setMagazineTurretAmmo is broken on split locality, use setAmmo for now private _weapon = (_vehicle weaponsTurret _turretPath) param [0, ""]; - TRACE_3("setAmmo",_vehicle,_weapon, _ammoLeft); + TRACE_3("setAmmo",_vehicle,_weapon,_ammoLeft); _vehicle setAmmo [_weapon, _ammoLeft]; private _currentAmmo = _vehicle magazineTurretAmmo [_vehMag, _turretPath]; - if ((_weapon == "") || {_currentAmmo != _ammoLeft}) then { ERROR_1("failed to setAmmo - %1", _this); }; + if ((_weapon == "") || {_currentAmmo != _ammoLeft}) then { ERROR_1("failed to setAmmo - %1",_this); }; } else { diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 42508daf1d..50081a87a5 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -23,11 +23,12 @@ params ["_vehicle", "_turret", "_carryMag", "_magSource", "_unit"]; TRACE_5("loadMagazine",_vehicle,_turret,_carryMag,_magSource,_unit); private _timeToLoad = 1; -if (!isNull(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime")) then { - _timeToLoad = getNumber(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime"); +private _config = configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime"; +if (!isNull _config) then { + _timeToLoad = getNumber _config; }; -private _displayName = format [localize LSTRING(loadX), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")]; +private _displayName = format [LLSTRING(loadX), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")]; private _onFinish = { (_this select 0) params ["_vehicle", "_turret", "_carryMag", "_magSource", "_unit"]; @@ -51,7 +52,7 @@ private _onFinish = { [_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); if (_bestAmmoToSend == 0) exitWith {}; - TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend, _unit); + TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend,_unit); [QGVAR(addTurretMag), [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend, _unit]] call CBA_fnc_globalEvent; }; diff --git a/addons/csw/functions/fnc_staticWeaponInit.sqf b/addons/csw/functions/fnc_staticWeaponInit.sqf deleted file mode 100644 index 6dcbbf52e6..0000000000 --- a/addons/csw/functions/fnc_staticWeaponInit.sqf +++ /dev/null @@ -1,98 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Initializes weapon to disable weapon disassembling - * - * Arguments: - * 0: Weapon - * - * Return Value: - * None - * - * Example: - * [weapon] call ace_csw_fnc_staticWeaponInit - * - * Public: No - */ - -params ["_staticWeapon"]; -if (isNull _staticWeapon) exitWith { WARNING_1("%1 became null",_staticWeapon) }; -private _typeOf = typeOf _staticWeapon; -private _configOf = configOf _staticWeapon; -private _configEnabled = (getNumber (_configOf >> "ace_csw" >> "enabled")) == 1; -private _assemblyConfig = _configEnabled && {(getText (_configOf >> "ace_csw" >> "disassembleWeapon")) != ""}; -TRACE_4("staticWeaponInit",_staticWeapon,_typeOf,_configEnabled,_assemblyConfig); - -if (_configEnabled && {GVAR(ammoHandling) == 2}) then { - TRACE_1("adding AI fired handler",_staticWeapon); - _staticWeapon addEventHandler ["Fired", LINKFUNC(ai_handleFired)]; - _staticWeapon addEventHandler ["GetIn", LINKFUNC(ai_handleGetIn)]; // handle AI getting inside weapon with no ammo -}; - -TRACE_2("",local _staticWeapon,_staticWeapon turretLocal [0]); -if (_configEnabled && {_staticWeapon turretLocal [0]}) then { // if turret is local to us, then handle mags/weapon - [{ - params ["_staticWeapon"]; - if (!alive _staticWeapon) exitWith { TRACE_1("dead/deleted",_staticWeapon); }; - // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] - private _assemblyModeIndex = _staticWeapon getVariable [QGVAR(assemblyMode), 3]; - private _emptyWeapon = _assemblyModeIndex isEqualTo 2; - private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select _assemblyModeIndex; - TRACE_2("turretLocal",_staticWeapon,_assemblyMode); - [_staticWeapon, [0], _assemblyMode, _emptyWeapon] call FUNC(proxyWeapon); - [_staticWeapon, _assemblyMode, _emptyWeapon] call FUNC(staticWeaponInit_unloadExtraMags); - }, [_staticWeapon]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly -}; - -if (_assemblyConfig) then { - [{ - params ["_staticWeapon"]; - if (!alive _staticWeapon) exitWith { TRACE_1("dead/deleted",_staticWeapon); }; - private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); - TRACE_2("assemblyConfig present",_staticWeapon,_assemblyMode); - if (_assemblyMode) then { // Disable vanilla assembly if assemblyMode enabled - [_staticWeapon, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - }; - }, [_staticWeapon]] call CBA_fnc_execNextFrame; // need to wait a frame to allow setting object vars during assembly -}; - -// Add interactions for players -if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { - GVAR(initializedStaticTypes) pushBack _typeOf; - TRACE_1("Adding Actions",_typeOf); - - if (_assemblyConfig) then { - private _disassembleAction = [QGVAR(disassemble), localize LSTRING(DisassembleCSW_displayName), "", {call FUNC(assemble_pickupWeapon)}, {call FUNC(assemble_canPickupWeapon)}] call EFUNC(interact_menu,createAction); - [_typeOf, 0, ["ACE_MainActions"], _disassembleAction] call EFUNC(interact_menu,addActionToClass); - }; - - - private _ammoActionPath = []; - private _magazineLocation = getText (_configOf >> QUOTE(ADDON) >> "magazineLocation"); - private _condition = { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; - // If magazine handling is enabled or weapon assembly/disassembly is enabled we enable ammo handling - if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; - [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) - }; - private _childenCode = { - BEGIN_COUNTER(getActions); // can remove for final release - private _ret = (call FUNC(reload_actionsLoad)) + (call FUNC(reload_actionsUnload)); - END_COUNTER(getActions); - _ret - }; - if (_configEnabled && {_magazineLocation != ""}) then { - private _positionCode = compile _magazineLocation; - private _ammoAction = [QGVAR(magazine), localize LSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); - _ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass); - } else { - private _ammoAction = [QGVAR(magazine), localize LSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction); - _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); - }; - - if (["ace_reload"] call EFUNC(common,isModLoaded)) then { - // move reload's check ammo action to the ammo handling point (remove and re-add) - [_typeOf, 0, ["ACE_MainActions", QEGVAR(reload,CheckAmmo)]] call EFUNC(interact_menu,removeActionFromClass); - private _checkAmmoAction = [QGVAR(checkAmmo), localize ELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction); - [_typeOf, 0, _ammoActionPath, _checkAmmoAction] call EFUNC(interact_menu,addActionToClass); - }; -}; diff --git a/addons/csw/script_config_macros_csw.hpp b/addons/csw/script_config_macros_csw.hpp index 1a0e1b3be5..6701159f29 100644 --- a/addons/csw/script_config_macros_csw.hpp +++ b/addons/csw/script_config_macros_csw.hpp @@ -1,15 +1 @@ #define CREATE_CSW_PROXY(weapon) class ##weapon; class GVAR(weapon): ##weapon { magazineReloadTime = 0.5; } - -// Need to be careful about breaking Attributes inheritance, doesn't seem to be any standard -#define ENABLE_CSW_ATTRIBUTE class Attributes { \ - class EGVAR(CSW,assemblyMode) { \ - property = QEGVAR(CSW,assemblyMode); \ - control = QEGVAR(CSW,assemblyModeControl); \ - displayName = ECSTRING(CSW,eden_enableCSW); \ - tooltip = ECSTRING(CSW,eden_enableCSW_tooltip); \ - expression = QUOTE( if (_value != 3) then {_this setVariable [ARR_3('%s',_value,true)]} ); \ - typeName = "NUMBER"; \ - condition = "objectVehicle"; \ - defaultValue = 3; \ - }; \ - } diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index b6f8ecb47e..4aea2a24b4 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -179,7 +179,7 @@ Scorta di munizioni 탄약 보관 Magazyn amunicji - 弾薬の格納場所 + 弾薬保管位置 弹药存储 Хранилище боеприпасов Almacenamiento de munición @@ -192,7 +192,7 @@ Determina se ulteriori caricatori verranno stoccati sul suolo o in una cassa di munizioni. 여분의 탄약을 지면 또는 탄약 상자에 넣을 지 결정합니다. Decyduje, czy dodatkowe magazynki przechowywane są na ziemi, czy w skrzynce z amunicją. - 追加の弾倉を地面に配置するか、弾薬箱内に保管するかを設定します。 + 追加の弾倉を地面に直接配置するか、弾薬箱内に保管するかを設定します。 设置多余的弹夹是存放在地面上还是弹药箱内 Определяет будут ли дополнительные магазины лежать на земле или внутри хранилища Determina si los cargadores extra son almacenados en el suelo o en una caja de munición diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index 5bc757e295..fc05185638 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -541,7 +541,7 @@ GVAR(menuRun) = true; }; case "options": { (__dsp displayCtrl __Option0) ctrlSetText "Signal Delay"; - (__dsp displayCtrl __Option1) ctrlSetText (if (GVAR(useDegrees)) then { "Direction: Deg" } else { "Direction: MIL" }); + (__dsp displayCtrl __Option1) ctrlSetText (["Direction: MIL", "Direction: Deg"] select GVAR(useDegrees)); (__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QPATHTOF(UI\DAGR_Selection.paa); if (GVAR(SEL)) then { GVAR(vectorConnected) = false; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index 21e19ff023..b7064ce248 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -65,10 +65,10 @@ GVAR(outputPFH) = [{ private _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]; + __gridControl ctrlSetText _dagrGrid; + __speedControl ctrlSetText _dagrSpeed; + __elevationControl ctrlSetText _dagrElevation; + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _dagrHeading } else { format ["%1 �", _dagrHeading] }); + __timeControl ctrlSetText _dagrTime; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index 5eb1b9bffa..e9bd0ea6c3 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -89,8 +89,8 @@ private _dagrDist = str GVAR(LAZDIST) + "m"; 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]; +__gridControl ctrlSetText _dagrGrid; +__speedControl ctrlSetText _dagrDist; +__elevationControl ctrlSetText _dagrElevation; +__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _bearing } else { format ["%1°", _bearing] }); +__timeControl ctrlSetText _dagrTime; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 2e0588ccc4..27944f0bb9 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -85,10 +85,10 @@ GVAR(outputPFH) = [{ }); // 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]; + __gridControl ctrlSetText _dagrGrid; + __speedControl ctrlSetText str _bearing; + __elevationControl ctrlSetText _dagrGrid2; + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _dagrHeading } else { format ["%1°", _dagrHeading] }); + __timeControl ctrlSetText _dagrDistance; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/disarming/XEH_postInit.sqf b/addons/disarming/XEH_postInit.sqf index 6944f8b146..5b123af297 100644 --- a/addons/disarming/XEH_postInit.sqf +++ b/addons/disarming/XEH_postInit.sqf @@ -1,4 +1,4 @@ #include "script_component.hpp" -[QGVAR(dropItems), FUNC(eventTargetStart)] call CBA_fnc_addEventHandler; -[QGVAR(debugCallback), FUNC(eventCallerFinish)] call CBA_fnc_addEventHandler; +[QGVAR(dropItems), LINKFUNC(eventTargetStart)] call CBA_fnc_addEventHandler; +[QGVAR(debugCallback), LINKFUNC(eventCallerFinish)] call CBA_fnc_addEventHandler; diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 26e00dfa5f..e1a4c379b4 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -50,7 +50,7 @@ if (!_doNotDropAmmo) then { if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); }; //Create a new weapon holder diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index a3762aec9f..da9a860678 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -74,7 +74,7 @@ GVAR(disarmTarget) = _target; private _rankPicture = _display displayCtrl 1203; //Show rank and name (just like BIS's inventory) - private _icon = format [DEFUALTPATH, toLower (rank _target)]; + private _icon = format [DEFUALTPATH, toLowerANSI (rank _target)]; if (_icon isEqualTo DEFUALTPATH) then {_icon = ""}; _rankPicture ctrlSetText _icon; _playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName)); @@ -93,7 +93,7 @@ GVAR(disarmTarget) = _target; if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); //If a holder exists, show it's inventory if (!isNull _holder) then { diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index e05e27c87e..11d7bd470b 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -55,7 +55,7 @@ params ["_listBoxCtrl", "_itemsCountArray"]; }; }; - _listBoxCtrl lbAdd format ["%1", _displayName]; + _listBoxCtrl lbAdd _displayName; _listBoxCtrl lbSetData [((lbSize _listBoxCtrl) - 1), _classname]; _listBoxCtrl lbSetPicture [((lbSize _listBoxCtrl) - 1), _picture]; _listBoxCtrl lbSetTextRight [((lbSize _listBoxCtrl) - 1), str _count]; diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index f683f6f253..d9c35dc172 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -1,9 +1,9 @@ #include "script_component.hpp" -[QGVAR(showDogtag), DFUNC(showDogtag)] call CBA_fnc_addEventHandler; -[QGVAR(sendDogtagData), DFUNC(sendDogtagData)] call CBA_fnc_addEventHandler; -[QGVAR(getDogtagItem), DFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; -[QGVAR(addDogtagItem), DFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; +[QGVAR(showDogtag), LINKFUNC(showDogtag)] call CBA_fnc_addEventHandler; +[QGVAR(sendDogtagData), LINKFUNC(sendDogtagData)] call CBA_fnc_addEventHandler; +[QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; +[QGVAR(addDogtagItem), LINKFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; // Add actions and event handlers only if ace_medical is loaded // - Adding actions via config would create a dependency diff --git a/addons/dogtags/stringtable.xml b/addons/dogtags/stringtable.xml index db3b0ee8fe..d19c61f505 100644 --- a/addons/dogtags/stringtable.xml +++ b/addons/dogtags/stringtable.xml @@ -54,7 +54,7 @@ Zabierz Взять Vezmi - 取る + 拾う Nehmen 회수 Prendre @@ -70,7 +70,7 @@ Zabrałeś nieśmiertelnik %1... Жетон снят с %1... Sebral jsem známku od %1... - %1 からドッグタグを取っています・・・ + %1 からドッグタグを回収しています・・・ Erkennungsmarke von %1 genommen... %1(으)로부터 군번줄을 회수했습니다... Plaque d'identification prise sur %1... @@ -86,7 +86,7 @@ Ktoś już zabrał ten nieśmiertelnik... Кто-то уже забрал жетон... Někdo jiný už vzal identifikační známku... - すでにドッグタグは取られています・・・ + 既に誰かがドッグタグを回収したようだ・・・ Jemand anderes hat bereits die Erkennungsmarke genommen... 누군가 이미 군번줄을 회수해갔습니다... Quelqu'un d'autre a déjà pris la plaque d'identification... @@ -102,7 +102,7 @@ Anzeige um Erkennungsmarke zu überprüfen 在畫面中顯示檢查兵籍牌 在画面中显示检查兵籍牌 - 確認中のドッグタグを画面上で表示します + 確認中のドッグタグを画面上に表示します Indicatore su schermo per il controllo delle piastrine Wyświetlacz ekranowy dla sprawdzania nieśmiertelników Экран для проверки жетонов diff --git a/addons/dragging/XEH_PREP.hpp b/addons/dragging/XEH_PREP.hpp index 37b9722e8e..0861c9533d 100644 --- a/addons/dragging/XEH_PREP.hpp +++ b/addons/dragging/XEH_PREP.hpp @@ -26,6 +26,8 @@ PREP(resumeDrag); PREP(setCarryable); PREP(setDraggable); PREP(startCarry); +PREP(startCarryLocal); PREP(startCarryPFH); PREP(startDrag); +PREP(startDragLocal); PREP(startDragPFH); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 84bcffb544..ae277bf4d2 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -67,6 +67,9 @@ if (isNil QGVAR(maxWeightCarryRun)) then { }; }] call CBA_fnc_addEventHandler; +[QGVAR(startCarry), LINKFUNC(startCarryLocal)] call CBA_fnc_addEventHandler; +[QGVAR(startDrag), LINKFUNC(startDragLocal)] call CBA_fnc_addEventHandler; + [QGVAR(carryingContainerClosed), { params ["_container", "_owner"]; TRACE_2("carryingContainerClosed EH",_container,_owner); diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index caea20fb8a..be3015868b 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -28,7 +28,7 @@ if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false}; // Static weapons need to be empty for carrying (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { - (crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1 + (crew _target) findIf {!unitIsUAV _x} == -1 }; // Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 33dcd134b6..586e23feaf 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -24,7 +24,7 @@ if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exi // Static weapons need to be empty for dragging (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { - (crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1 + (crew _target) findIf {!unitIsUAV _x} == -1 }; // Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index dfff18a3c0..4d5ac8b61b 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -53,7 +53,7 @@ _unit setVariable [QGVAR(releaseActionID), [ ] call EFUNC(common,addActionEventHandler)]; // Add anim changed EH -[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; +[_unit, "AnimChanged", LINKFUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; // Prevent UAVs from firing private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); @@ -67,7 +67,4 @@ if (_UAVCrew isNotEqualTo []) then { }; // Check everything -[FUNC(carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; - -// Reset current dragging height -GVAR(currentHeightChange) = 0; +[LINKFUNC(carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index b73ff97261..fcd0f05376 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -35,15 +35,35 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop if the crate is destroyed OR target moved away from carrier (weapon disassembled) OR carrier starts limping -if !(alive _target && {_unit distance _target <= 10} && {_unit getHitPointDamage "HitLegs" < 0.5}) exitWith { - TRACE_2("dead/distance",_unit,_target); +// Drop if the target is destroyed +if (!alive _target) exitWith { + TRACE_2("dead",_unit,_target); - if ((_unit distance _target > 10) && {(CBA_missionTime - _startTime) < 1}) exitWith { - // attachTo seems to have some kind of network delay and target can return an odd position during the first few frames, - // So wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos) - TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime); - }; + [_unit, _target] call FUNC(dropObject_carry); + + _unit setVariable [QGVAR(hint), nil]; + call EFUNC(interaction,hideMouseHint); + + _idPFH call CBA_fnc_removePerFrameHandler; +}; + +// Drop if the target moved away from carrier (e.g. weapon disassembled) +// attachTo seems to have some kind of network delay and target can return an odd position during the first few frames, +// So wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos) +if (_unit distance _target > 10 && {(CBA_missionTime - _startTime) >= 1}) exitWith { + TRACE_2("distance",_unit,_target); + + [_unit, _target] call FUNC(dropObject_carry); + + _unit setVariable [QGVAR(hint), nil]; + call EFUNC(interaction,hideMouseHint); + + _idPFH call CBA_fnc_removePerFrameHandler; +}; + +// Drop if the carrier starts limping +if (_unit getHitPointDamage "HitLegs" >= 0.5) exitWith { + TRACE_2("limping",_unit,_target); [_unit, _target] call FUNC(dropObject_carry); @@ -54,7 +74,7 @@ if !(alive _target && {_unit distance _target <= 10} && {_unit getHitPointDamage }; // Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {(crew _target) isNotEqualTo []} && {!(_target getVariable [QGVAR(isUAV), false])}) then { +if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject_carry); diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index ddad0ad7bb..5116f440b3 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -57,7 +57,7 @@ GVAR(releaseActionID) = [0xF1, [false, false, false], { ["", LLSTRING(Drop)] call EFUNC(interaction,showMouseHint); // Block firing -if !(GVAR(dragAndFire)) then { +if (!GVAR(dragAndFire)) then { _unit setVariable [QGVAR(blockFire), [ _unit, "DefaultAction", {true}, @@ -66,10 +66,11 @@ if !(GVAR(dragAndFire)) then { }; // Add anim changed EH -[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; +[_unit, "AnimChanged", LINKFUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; // Prevent UAVs from firing private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); + if (_UAVCrew isNotEqualTo []) then { { _target deleteVehicleCrew _x; @@ -79,10 +80,7 @@ if (_UAVCrew isNotEqualTo []) then { }; // Check everything -[FUNC(dragObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; - -// Reset current dragging height. -GVAR(currentHeightChange) = 0; +[LINKFUNC(dragObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; // Fixes not being able to move when in combat pace [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index a2895f4216..7c3a6be307 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -31,15 +31,20 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) -if (!alive _target || {_unit distance _target > 10}) then { - TRACE_2("dead/distance",_unit,_target); +// Drop if the target is destroyed +if (!alive _target) exitWith { + TRACE_2("dead",_unit,_target); - if ((_unit distance _target > 10) && {(CBA_missionTime - _startTime) < 1}) exitWith { - // attachTo seems to have some kind of network delay and target can return an odd position during the first few frames, - // So wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos) - TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime); - }; + [_unit, _target] call FUNC(dropObject); + + _idPFH call CBA_fnc_removePerFrameHandler; +}; + +// Drop if the target moved away from carrier (e.g. weapon disassembled) +// attachTo seems to have some kind of network delay and target can return an odd position during the first few frames, +// So wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos) +if (_unit distance _target > 10 && {(CBA_missionTime - _startTime) >= 1}) exitWith { + TRACE_2("distance",_unit,_target); [_unit, _target] call FUNC(dropObject); @@ -47,7 +52,7 @@ if (!alive _target || {_unit distance _target > 10}) then { }; // Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {(crew _target) isNotEqualTo []} && {!(_target getVariable [QGVAR(isUAV), false])}) then { +if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject); diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index debe757101..10cfda1703 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -26,7 +26,7 @@ if (!isNil QGVAR(releaseActionID)) then { }; // Stop blocking -if !(GVAR(dragAndFire)) then { +if (!GVAR(dragAndFire)) then { [_unit, "DefaultAction", _unit getVariable [QGVAR(blockFire), -1]] call EFUNC(common,removeActionEventHandler); }; @@ -82,7 +82,9 @@ if (_unit getVariable ["ACE_isUnconscious", false]) then { // Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) if (_target getVariable [QGVAR(isUAV), false]) then { - [{ + _target setVariable [QGVAR(isUAV), nil, true]; + + [{ params ["_target"]; if (!alive _target) exitWith {}; TRACE_2("restoring uav crew",_target,getPosASL _target); diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index f3f15fac14..184b1755c0 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -44,7 +44,7 @@ if (_tryLoad && {!(_target isKindOf "CAManBase")} && {["ace_cargo"] call EFUNC(c // Fix anim when aborting carrying persons if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { - if (vehicle _unit == _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + if (isNull objectParent _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { [_unit, "", 2] call EFUNC(common,doAnimation); }; @@ -88,6 +88,8 @@ if !(_target isKindOf "CAManBase") then { // Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) if (_target getVariable [QGVAR(isUAV), false]) then { + _target setVariable [QGVAR(isUAV), nil, true]; + [{ params ["_target"]; if (!alive _target) exitWith {}; diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index 8b522e34bc..c7641a8ffa 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -27,7 +27,7 @@ private _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull]; // Disabled for persons if (_carriedItem isKindOf "CAManBase") exitWith {false}; -if !(CBA_events_control) then { +if (!CBA_events_control) then { // Raise/lower // Move carried item 15 cm per scroll interval _scrollAmount = _scrollAmount * 0.15; diff --git a/addons/dragging/functions/fnc_pauseCarry.sqf b/addons/dragging/functions/fnc_pauseCarry.sqf index bfe27420f6..49c91e166f 100644 --- a/addons/dragging/functions/fnc_pauseCarry.sqf +++ b/addons/dragging/functions/fnc_pauseCarry.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: johnb43 - * Removes user input affecting dragging. + * Removes user input affecting carrying. * * Arguments: * 0: Unit diff --git a/addons/dragging/functions/fnc_resumeCarry.sqf b/addons/dragging/functions/fnc_resumeCarry.sqf index 233d60e298..e7cdeb5dc6 100644 --- a/addons/dragging/functions/fnc_resumeCarry.sqf +++ b/addons/dragging/functions/fnc_resumeCarry.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -// If not dragging, don't do anything +// If not carrying, don't do anything if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {}; // If action is already present, don't add it again diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 174bdbf972..60b9854f41 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -56,8 +56,25 @@ GVAR(initializedClasses_carry) = _initializedClasses; private _icon = [QPATHTOF(UI\icons\box_carry.paa), QPATHTOF(UI\icons\person_carry.paa)] select (_object isKindOf "CAManBase"); -private _carryAction = [QGVAR(carry), LLSTRING(Carry), _icon, {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); -private _dropAction = [QGVAR(drop_carry), LLSTRING(Drop), "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction); +private _carryAction = [ + QGVAR(carry), + LLSTRING(Carry), + _icon, + { + [_player, _target] call FUNC(startCarry) + }, { + [_player, _target] call FUNC(canCarry) +}] call EFUNC(interact_menu,createAction); + +private _dropAction = [ + QGVAR(drop_carry), + LLSTRING(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 a00e3005e9..e024ec5be2 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -56,8 +56,25 @@ GVAR(initializedClasses) = _initializedClasses; private _icon = [QPATHTOF(UI\icons\box_drag.paa), QPATHTOF(UI\icons\person_drag.paa)] select (_object isKindOf "CAManBase"); -private _dragAction = [QGVAR(drag), LLSTRING(Drag), _icon, {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction); -private _dropAction = [QGVAR(drop), LLSTRING(Drop), "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction); +private _dragAction = [ + QGVAR(drag), + LLSTRING(Drag), + _icon, + { + [_player, _target] call FUNC(startDrag) + }, { + [_player, _target] call FUNC(canDrag) +}] call EFUNC(interact_menu,createAction); + +private _dropAction = [ + QGVAR(drop), + LLSTRING(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 040b701f71..3e2cc17efd 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: commy2, PiZZADOX - * Starts the carrying process. + * Author: johnb43 + * Starts the carrying process safely. * * Arguments: * 0: Unit that should do the carrying @@ -11,82 +11,11 @@ * None * * Example: - * [player, cursorTarget] call ace_dragging_fnc_startCarry; + * [player, cursorTarget] call ace_dragging_fnc_startCarry * * Public: No */ - params ["_unit", "_target"]; -TRACE_2("params",_unit,_target); -// Exempt from weight check if object has override variable set -private _weight = 0; - -if !(_target getVariable [QGVAR(ignoreWeightCarry), false]) then { - _weight = _target call FUNC(getWeight); -}; - -// Exit if object weight is over global var value -if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { - [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); -}; - -private _timer = CBA_missionTime + 5; - -// Handle objects vs. persons -if (_target isKindOf "CAManBase") then { - private _primaryWeapon = primaryWeapon _unit; - - // Add a primary weapon if the unit has none - if (_primaryWeapon == "") then { - _unit addWeapon "ACE_FakePrimaryWeapon"; - _primaryWeapon = "ACE_FakePrimaryWeapon"; - }; - - // Select primary, otherwise the drag animation actions don't work - _unit selectWeapon _primaryWeapon; - - // Move a bit closer and adjust direction when trying to pick up a person - [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; - _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit)); - - [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2] call EFUNC(common,doAnimation); - [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2] call EFUNC(common,doAnimation); - - _timer = CBA_missionTime + 10; -} else { - // Select no weapon and stop sprinting - private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex); - _unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true]; - - _unit action ["SwitchWeapon", _unit, _unit, 299]; - - [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); - - private _canRun = _weight call FUNC(canRun_carry); - - // Only force walking if we're overweight - [_unit, "forceWalk", QUOTE(ADDON), !_canRun] call EFUNC(common,statusEffect_set); - [_unit, "blockSprint", QUOTE(ADDON), _canRun] call EFUNC(common,statusEffect_set); -}; - -[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - -// Prevent multiple players from accessing the same object -[_unit, _target, true] call EFUNC(common,claim); - -// Prevents dragging and carrying at the same time -_unit setVariable [QGVAR(isCarrying), true, true]; - -// Required for aborting animation -_unit setVariable [QGVAR(carriedObject), _target, true]; - -[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler; - -// Disable collisions by setting the PhysX mass to almost zero -private _mass = getMass _target; - -if (_mass > 1) then { - _target setVariable [QGVAR(originalMass), _mass, true]; - [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync -}; +// Try to claim the object +[QEGVAR(common,claimSafe), [_unit, _target, true, QGVAR(startCarry)]] call CBA_fnc_serverEvent; diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf new file mode 100644 index 0000000000..6ba2c68934 --- /dev/null +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -0,0 +1,95 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, PiZZADOX + * Starts the carrying process. + * + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry + * 2: If object was successfully claimed + * + * Return Value: + * None + * + * Example: + * [player, cursorTarget, true] call ace_dragging_fnc_startCarryLocal + * + * Public: No + */ + +params ["_unit", "_target", "_claimed"]; +TRACE_3("params",_unit,_target,_claimed); + +if (!_claimed) exitWith { WARNING_1("already claimed %1",_this) }; + +// Exempt from weight check if object has override variable set +private _weight = 0; + +if !(_target getVariable [QGVAR(ignoreWeightCarry), false]) then { + _weight = _target call FUNC(getWeight); +}; + +// Exit if object weight is over global var value +if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { + // Release claim on object + [objNull, _target, true] call EFUNC(common,claim); + + [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); +}; + +private _timer = CBA_missionTime + 5; + +// Handle objects vs. persons +if (_target isKindOf "CAManBase") then { + private _primaryWeapon = primaryWeapon _unit; + + // Add a primary weapon if the unit has none + if (_primaryWeapon == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; + _primaryWeapon = "ACE_FakePrimaryWeapon"; + }; + + // Select primary, otherwise the carry animation actions don't work + _unit selectWeapon _primaryWeapon; + + // Move a bit closer and adjust direction when trying to pick up a person + [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; + _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit)); + + [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2] call EFUNC(common,doAnimation); + [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2] call EFUNC(common,doAnimation); + + _timer = CBA_missionTime + 10; +} else { + // Select no weapon and stop sprinting + private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex); + _unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true]; + + _unit action ["SwitchWeapon", _unit, _unit, 299]; + + [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); + + private _canRun = _weight call FUNC(canRun_carry); + + // Only force walking if we're overweight + [_unit, "forceWalk", QUOTE(ADDON), !_canRun] call EFUNC(common,statusEffect_set); + [_unit, "blockSprint", QUOTE(ADDON), _canRun] call EFUNC(common,statusEffect_set); +}; + +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// Prevents dragging and carrying at the same time +_unit setVariable [QGVAR(isCarrying), true, true]; + +// Required for aborting animation +_unit setVariable [QGVAR(carriedObject), _target, true]; + +[LINKFUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler; + +// Disable collisions by setting the PhysX mass to almost zero +private _mass = getMass _target; + +if (_mass > 1) then { + _target setVariable [QGVAR(originalMass), _mass, true]; + [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync +}; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index ca34275a2c..f928ef942a 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -32,9 +32,9 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) -if (!alive _target || {_unit distance _target > 10}) then { - TRACE_4("dead/distance",_unit,_target,_timeOut,CBA_missionTime); +// Drop if the target is destroyed, if the target moved away from carrier (e.g. weapon disassembled) or if the carrier starts limping +if !(alive _target && {_unit distance _target <= 10} && {_unit getHitPointDamage "HitLegs" < 0.5}) exitWith { + TRACE_4("dead/distance/limping",_unit,_target,_timeOut,CBA_missionTime); [_unit, _target] call FUNC(dropObject_carry); _idPFH call CBA_fnc_removePerFrameHandler; @@ -42,7 +42,7 @@ if (!alive _target || {_unit distance _target > 10}) then { // Handle persons vs. objects if (_target isKindOf "CAManBase") then { - // Drop if in timeout + // Carry person after timeout (animation takes a long time to finish) if (CBA_missionTime > _timeOut) exitWith { TRACE_4("Start carry person",_unit,_target,_timeOut,CBA_missionTime); [_unit, _target] call FUNC(carryObject); @@ -50,13 +50,13 @@ if (_target isKindOf "CAManBase") then { _idPFH call CBA_fnc_removePerFrameHandler; }; } else { - // Drop if in timeout + // Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time if (CBA_missionTime > _timeOut) exitWith { TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime); _idPFH call CBA_fnc_removePerFrameHandler; - private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; - [_unit, _draggedObject] call FUNC(dropObject_carry); + private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + [_unit, _carriedObject] call FUNC(dropObject_carry); }; // Wait for the unit to stand up diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index cd298804e6..8dd6db6dee 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -1,104 +1,21 @@ #include "..\script_component.hpp" /* - * Author: commy2, PiZZADOX, Malbryn - * Starts the dragging process. + * Author: johnb43 + * Starts the dragging process safely. * * Arguments: - * 0: Unit that should do the dragging + * 0: Unit that should do the carrying * 1: Object to drag * * Return Value: * None * * Example: - * [player, cursorTarget] call ace_dragging_fnc_startDrag; + * [player, cursorTarget] call ace_dragging_fnc_startDrag * * Public: No */ - params ["_unit", "_target"]; -TRACE_2("params",_unit,_target); -// Exempt from weight check if object has override variable set -private _weight = 0; - -if !(_target getVariable [QGVAR(ignoreWeightDrag), false]) then { - _weight = _target call FUNC(getWeight); -}; - -// Exit if object weight is over global var value -if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { - [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); -}; - -private _primaryWeapon = primaryWeapon _unit; - -// Add a primary weapon if the unit has none -if !(GVAR(dragAndFire)) then { - if (_primaryWeapon == "") then { - _unit addWeapon "ACE_FakePrimaryWeapon"; - _primaryWeapon = "ACE_FakePrimaryWeapon"; - }; - - _unit selectWeapon _primaryWeapon; -} else { // Making sure the unit is holding a primary weapon or handgun - private _handgunWeapon = handgunWeapon _unit; - - if !(currentWeapon _unit in [_primaryWeapon, _handgunWeapon]) then { - if (_primaryWeapon != "") then { - // Use primary if possible - _unit selectWeapon _primaryWeapon; - } else { - if (_handgunWeapon != "") then { - // Use pistol if unit has no primary - _unit selectWeapon _handgunWeapon; - } else { - // Add fake weapon if no weapons besides launcher are available - _unit addWeapon "ACE_FakePrimaryWeapon"; - _unit selectWeapon "ACE_FakePrimaryWeapon"; - }; - }; - }; -}; - -// Save the weapon so we can monitor if it changes -_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit]; - -[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - -// Prevent multiple players from accessing the same object -[_unit, _target, true] call EFUNC(common,claim); - -// Can't play action that depends on weapon if it was added the same frame -if !(_unit call EFUNC(common,isSwimming)) then { - [{ - private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""]; - - if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then { - [_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture); - } else { - [_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture); - }; - }, _unit] call CBA_fnc_execNextFrame; -}; - -// Move a bit closer and adjust direction when trying to pick up a person -if (_target isKindOf "CAManBase") then { - [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; - _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); - - [_target, "AinjPpneMrunSnonWnonDb_grab", 2] call EFUNC(common,doAnimation); -}; - -// Prevents dragging and carrying at the same time -_unit setVariable [QGVAR(isDragging), true, true]; - -[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler; - -// Disable collisions by setting the physx mass to almost zero -private _mass = getMass _target; - -if (_mass > 1) then { - _target setVariable [QGVAR(originalMass), _mass, true]; - [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync -}; +// Try to claim the object +[QEGVAR(common,claimSafe), [_unit, _target, true, QGVAR(startDrag)]] call CBA_fnc_serverEvent; diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf new file mode 100644 index 0000000000..22c7cecd24 --- /dev/null +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -0,0 +1,107 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, PiZZADOX, Malbryn + * Starts the dragging process. + * + * Arguments: + * 0: Unit that should do the dragging + * 1: Object to drag + * 2: If object was successfully claimed + * + * Return Value: + * None + * + * Example: + * [player, cursorTarget, true] call ace_dragging_fnc_startDragLocal + * + * Public: No + */ + +params ["_unit", "_target", "_claimed"]; +TRACE_3("params",_unit,_target,_claimed); + +if (!_claimed) exitWith { WARNING_1("already claimed %1",_this) }; + +// Exempt from weight check if object has override variable set +private _weight = 0; + +if !(_target getVariable [QGVAR(ignoreWeightDrag), false]) then { + _weight = _target call FUNC(getWeight); +}; + +// Exit if object weight is over global var value +if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { + // Release claim on object + [objNull, _target, true] call EFUNC(common,claim); + + [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); +}; + +private _primaryWeapon = primaryWeapon _unit; + +// Add a primary weapon if the unit has none +if (!GVAR(dragAndFire)) then { + if (_primaryWeapon == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; + _primaryWeapon = "ACE_FakePrimaryWeapon"; + }; + + _unit selectWeapon _primaryWeapon; +} else { // Making sure the unit is holding a primary weapon or handgun + private _handgunWeapon = handgunWeapon _unit; + + if !(currentWeapon _unit in [_primaryWeapon, _handgunWeapon]) then { + if (_primaryWeapon != "") then { + // Use primary if possible + _unit selectWeapon _primaryWeapon; + } else { + if (_handgunWeapon != "") then { + // Use pistol if unit has no primary + _unit selectWeapon _handgunWeapon; + } else { + // Add fake weapon if no weapons besides launcher are available + _unit addWeapon "ACE_FakePrimaryWeapon"; + _unit selectWeapon "ACE_FakePrimaryWeapon"; + }; + }; + }; +}; + +// Save the weapon so we can monitor if it changes +_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit]; + +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// Can't play action that depends on weapon if it was added the same frame +if !(_unit call EFUNC(common,isSwimming)) then { + [{ + private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""]; + + if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then { + [_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture); + } else { + [_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture); + }; + }, _unit] call CBA_fnc_execNextFrame; +}; + +// Move a bit closer and adjust direction when trying to pick up a person +if (_target isKindOf "CAManBase") then { + [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; + _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); + + [_target, "AinjPpneMrunSnonWnonDb_grab", 2] call EFUNC(common,doAnimation); +}; + +// Prevents dragging and carrying at the same time +_unit setVariable [QGVAR(isDragging), true, true]; + +[LINKFUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler; + +// Disable collisions by setting the physx mass to almost zero +private _mass = getMass _target; + +if (_mass > 1) then { + _target setVariable [QGVAR(originalMass), _mass, true]; + [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync +}; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 07dfe2064f..daf887c362 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -32,15 +32,15 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Same as dragObjectPFH, checks if object is deleted, dead or target moved away from carrier (e.g. weapon disassembled) -if (!alive _target || {_unit distance _target > 10}) then { +// Drop if the target is destroyed or if the target moved away from carrier (e.g. weapon disassembled) +if (!alive _target || {_unit distance _target > 10}) exitWith { TRACE_4("dead/distance",_unit,_target,_timeOut,CBA_missionTime); [_unit, _target] call FUNC(dropObject); _idPFH call CBA_fnc_removePerFrameHandler; }; -// Timeout: Do nothing, quit. CBA_missionTime, because anim length is linked to ingame time +// Timeout: Drop target. CBA_missionTime, because anim length is linked to ingame time if (CBA_missionTime > _timeOut) exitWith { TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime); _idPFH call CBA_fnc_removePerFrameHandler; diff --git a/addons/dragging/initKeybinds.inc.sqf b/addons/dragging/initKeybinds.inc.sqf index 8ee36d0283..a8792f3576 100644 --- a/addons/dragging/initKeybinds.inc.sqf +++ b/addons/dragging/initKeybinds.inc.sqf @@ -5,7 +5,7 @@ if (!alive _player) exitWith {false}; if !([_player, objNull, ["isNotDragging", "isNotCarrying", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // If we are drag/carrying something right now then just drop it: + // If we are dragging/carrying something right now then just drop it if (_player getVariable [QGVAR(isDragging), false]) exitWith { [_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); @@ -34,7 +34,7 @@ if (!alive _player) exitWith {false}; if !([_player, objNull, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // If we are drag/carrying something right now then just drop it: + // If we are dragging/carrying something right now then just drop it if (_player getVariable [QGVAR(isDragging), false]) exitWith { [_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); diff --git a/addons/dragging/initSettings.inc.sqf b/addons/dragging/initSettings.inc.sqf index 039327330d..37feef4cbc 100644 --- a/addons/dragging/initSettings.inc.sqf +++ b/addons/dragging/initSettings.inc.sqf @@ -21,7 +21,7 @@ [LSTRING(allowRunWithLightweight_DisplayName), LSTRING(allowRunWithLightweight_Description)], LLSTRING(SettingsName), true, - true + 1 ] call CBA_fnc_addSetting; [ @@ -30,5 +30,5 @@ [LSTRING(skipContainerWeight_DisplayName), LSTRING(skipContainerWeight_Description)], LLSTRING(SettingsName), false, - true + 1 ] call CBA_fnc_addSetting; diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 5c8a355be2..9552f50273 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -166,6 +166,7 @@ 가벼운 개체 들고 달리기 허용 Autoriser la course avec des objets légers Permitir corrida com objetos leves + Позволяет работать с легкими объектами Allow the player to run when carrying lightweight objects. @@ -176,6 +177,7 @@ 가벼운 개체를 들고 다닐 때 플레이어가 뛸 수 있도록 허용합니다. Autorise le joueur à courir lorsqu'il porte un objet léger. Permite ao jogador correr enquanto carrega objetos leves. + Разрешите игроку бегать при переноске легких предметов. Skip Object Weight @@ -186,16 +188,18 @@ 개체 무게 무시 Ignorer le poids de l'objet Ignorar Peso do Objeto + Игнорировать вес объекта Determines whether object's weight is added onto weight calculations. - 重量計算にオブジェクトの重量を追加するかどうかを決定します。 + 重量計算にオブジェクトの重量を追加するかどうかを定義します。 Determina se la massa del contenitore è sommata alla massa del contenuto per i calcoli di peso. Określa, czy waga obiektu jest dodawana do obliczeń ciężaru. Legt fest, ob das Gewicht des Objekts zu den Gewichtsberechnungen hinzugefügt wird. 무게 계산에 개체의 무게를 추가할 지 여부를 결정합니다. Défini si le poids d'un objet est ajouté aux calculs du poids. Determina se o peso do objeto é adicionado aos cálculos de peso. + Определяет, добавляется ли вес объекта при расчете веса. Max Weight Coefficient @@ -205,6 +209,7 @@ Coeficiente Máximo de Peso Maximaler Gewichtskoeffizient 最大重量係数 + Максимальный коэффициент веса Modifies weight limit calculations. Set to 0 to ignore. @@ -214,6 +219,7 @@ Modifica os cálculos do limite de peso. Defina como 0 para ignorar. Ändert die Berechnung der Gewichtsbegrenzung. Zum Ignorieren auf 0 setzen. 重量制限の計算を変更します。 無視するには 0 に設定します。 + Изменяет расчеты предельного веса. Установите значение 0 для игнорирования. diff --git a/addons/dragon/functions/fnc_canPickupTripod.sqf b/addons/dragon/functions/fnc_canPickupTripod.sqf index 3d556385e5..a103277972 100644 --- a/addons/dragon/functions/fnc_canPickupTripod.sqf +++ b/addons/dragon/functions/fnc_canPickupTripod.sqf @@ -21,5 +21,4 @@ params ["_target", "_unit"]; && {!alive (gunner _target)} && {!(_target getVariable [QGVAR(fired), false])} && {!(_target getVariable [QGVAR(sightAttached), ((typeOf _target) == QGVAR(staticAssembled))])} -&& EFUNC(csw,assemble_canPickupTripod) - +&& EFUNC(csw,canPickupTripod) diff --git a/addons/explosives/XEH_PREP.hpp b/addons/explosives/XEH_PREP.hpp index 319bd2fec2..444b9db2ea 100644 --- a/addons/explosives/XEH_PREP.hpp +++ b/addons/explosives/XEH_PREP.hpp @@ -10,6 +10,7 @@ PREP(cancelPlacement); PREP(canDefuse); PREP(canDetonate); PREP(connectExplosive); +PREP(cycleActiveTrigger); PREP(defuseExplosive); PREP(detonateExplosive); PREP(detonateExplosiveAll); diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index bee84c5b0f..81ab1b5406 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -27,7 +27,7 @@ }; }; }] call CBA_fnc_addEventHandler; -[QGVAR(startDefuse), FUNC(startDefuse)] call CBA_fnc_addEventHandler; +[QGVAR(startDefuse), LINKFUNC(startDefuse)] call CBA_fnc_addEventHandler; //When getting knocked out in medical, trigger deadman explosives: //Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) @@ -50,13 +50,15 @@ if (isServer) then { ["ace_unconscious", { params ["_unit", "_isUnconscious"]; if (!_isUnconscious) exitWith {}; - TRACE_1("Knocked Out, Doing Deadman", _unit); + TRACE_1("Knocked Out, Doing Deadman",_unit); [_unit] call FUNC(onIncapacitated); }] call CBA_fnc_addEventHandler; }; if (!hasInterface) exitWith {}; +#include "initKeybinds.inc.sqf" + GVAR(PlacedCount) = 0; GVAR(Setup) = objNull; GVAR(pfeh_running) = false; diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index a6b4e97ed3..e39270f0bb 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -10,6 +10,8 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" +GVAR(activeTrigger) = ""; + GVAR(detonationHandlers) = []; GVAR(excludedMines) = []; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index 2ac69b73ae..d35b303fc1 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -29,10 +29,10 @@ private _hasRequired = true; private _detonators = [_unit] call FUNC(getDetonators); { - if !(_x in _detonators) exitWith{ + if !(_x in _detonators) exitWith { _hasRequired = false; }; -} count _requiredItems; +} forEach _requiredItems; private _code = ""; while {true} do { diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index c353f973c3..ea4b87128a 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -49,18 +49,43 @@ private _explosivesList = []; }; }; } forEach _result; -if (_detonator != "ACE_DeadManSwitch") then { - // Add action to detonate all explosives tied to the detonator - if (count _explosivesList > 0) then { - _children pushBack [ + +// If the detonator is not active, is a clacker and has assigned explosives, generate an interaction to make it the active detonator for use with the "trigger all" keybind +if ( + _detonator != GVAR(activeTrigger) && + {_detonator != "Cellphone"} && + { + _explosivesList isNotEqualTo [] || + {_detonator == "ACE_DeadManSwitch" && {_unit getVariable [QGVAR(deadmanInvExplosive), ""] != ""}} + } +) then { + _children pushBack [ [ - "Explosive_All", - localize LSTRING(DetonateAll), - getText(ConfigFile >> "CfgWeapons" >> _detonator >> "picture"), - {(_this select 2) call FUNC(detonateExplosiveAll);}, + QGVAR(setActiveTrigger), + LLSTRING(SetActiveTrigger), + "", + {GVAR(activeTrigger) = (_this select 2) select 0;}, {true}, {}, - [_unit,_range,_explosivesList, _detonator] + [_detonator] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; +}; + +if (_detonator != "ACE_DeadManSwitch") then { + // Add action to detonate all explosives tied to the detonator + if (count _explosivesList > 1) then { + _children pushBack [ + [ + "Explosive_All", + LLSTRING(DetonateAll), + getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), + {(_this select 2) call FUNC(detonateExplosiveAll);}, + {true}, + {}, + [_unit, _range, _explosivesList, _detonator] ] call EFUNC(interact_menu,createAction), [], _unit @@ -69,15 +94,15 @@ if (_detonator != "ACE_DeadManSwitch") then { } else { //Add action to detonate all explosives (including the inventory explosive): _children pushBack [ - [ - "Explosive_All_Deadman", - localize LSTRING(DetonateAll), - getText(ConfigFile >> "CfgWeapons" >> _detonator >> "picture"), - {[_player] call FUNC(onIncapacitated)}, - {true} - ] call EFUNC(interact_menu,createAction), - [], - _unit + [ + "Explosive_All_Deadman", + LLSTRING(DetonateAll), + getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), + {[_player] call FUNC(onIncapacitated)}, + {true} + ] call EFUNC(interact_menu,createAction), + [], + _unit ]; //Adds actions for the explosives you can connect to the deadman switch. @@ -89,7 +114,7 @@ if (_detonator != "ACE_DeadManSwitch") then { _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; if (_connectedInventoryExplosive != "") then { - //Add the disconect action + //Add the disconnect action private _magConfig = configFile >> "CfgMagazines" >> _connectedInventoryExplosive; private _name = if ((getText (_magConfig >> "displayNameShort")) != "") then { getText (_magConfig >> "displayNameShort") @@ -99,17 +124,20 @@ if (_detonator != "ACE_DeadManSwitch") then { private _picture = getText (_magConfig >> "picture"); _children pushBack [ - ([ - "Deadman_disconnect", - format ["%1 %2", localize "str_disp_disconnect", _name], - _picture, - { - params ["_player"]; - TRACE_1("clear",_player); - _player setVariable [QGVAR(deadmanInvExplosive), "", true]; - }, - {true} - ] call EFUNC(interact_menu,createAction)), [], _unit]; + ([ + "Deadman_disconnect", + format ["%1 %2", localize "str_disp_disconnect", _name], + _picture, + { + params ["_player"]; + TRACE_1("clear",_player); + _player setVariable [QGVAR(deadmanInvExplosive), "", true]; + }, + {true} + ] call EFUNC(interact_menu,createAction)), + [], + _unit + ]; } else { //Add all magazines that would work with the deadman switch diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index d3632d5bb7..b6b6e0ce41 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -31,7 +31,7 @@ private _children = []; if !(_x in _detonators) exitWith { _hasRequiredItems = false; }; - } count _required; + } forEach _required; if (_hasRequiredItems && {(!_isAttached) || {(getNumber (_x >> "isAttachable")) == 1}}) then { _children pushBack [ diff --git a/addons/explosives/functions/fnc_canDefuse.sqf b/addons/explosives/functions/fnc_canDefuse.sqf index 0edb98cff5..54bf8477bc 100644 --- a/addons/explosives/functions/fnc_canDefuse.sqf +++ b/addons/explosives/functions/fnc_canDefuse.sqf @@ -24,7 +24,7 @@ if (isNull _explosive) exitWith { deleteVehicle _target; false }; -if (vehicle _unit != _unit || {(_unit call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}) exitWith {false}; +if (!isNull objectParent _unit || {(_unit call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}) exitWith {false}; if (GVAR(RequireSpecialist) && {!([_unit] call EFUNC(Common,isEOD))}) exitWith {false}; diff --git a/addons/explosives/functions/fnc_cycleActiveTrigger.sqf b/addons/explosives/functions/fnc_cycleActiveTrigger.sqf new file mode 100644 index 0000000000..e5226c6165 --- /dev/null +++ b/addons/explosives/functions/fnc_cycleActiveTrigger.sqf @@ -0,0 +1,53 @@ +#include "..\script_component.hpp" +/* + * Author: mrschick + * Cycles the "Active Trigger" of a unit and shows a CBA Hint that displays the new Active Trigger. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [ACE_player] call ace_explosives_fnc_cycleActiveTrigger; + * + * Public: No + */ + +params ["_unit"]; +TRACE_1("params",_unit); + +private _detonators = _unit call FUNC(getDetonators); + +// Remove ACE_Cellphone from list, as it should never be the active trigger due to having its own keybind +_detonators deleteAt (_detonators findIf {_x == "ACE_Cellphone"}); + +// Reset Active Trigger if none available +if (_detonators isEqualTo []) exitWith { + GVAR(activeTrigger) = ""; +}; + +private _activeTrigger = GVAR(activeTrigger); +private _index = _detonators findIf {_x == _activeTrigger}; +private _count = count _detonators; + +if (_activeTrigger != "" && {_index != -1} && {_count > 1}) then { + // If active trigger is set and among current detonators, switch to the next one + if (_index < _count - 1) then { + _index = _index + 1; + } else { + _index = 0; + }; + _activeTrigger = _detonators select _index; +} else { + // Assign first detonator in list as the active one + _activeTrigger = _detonators select 0; +}; + +GVAR(activeTrigger) = _activeTrigger; +private _triggerConfig = configFile >> "CfgWeapons" >> _activeTrigger; +private _triggerName = getText (_triggerConfig >> "displayName"); +private _triggerIcon = getText (_triggerConfig >> "picture"); + +[format ["%1: %2", LLSTRING(ActiveTrigger), _triggerName], _triggerIcon] call EFUNC(common,displayTextPicture); diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index 860f7ddfde..f0609e2b0d 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -30,7 +30,7 @@ for "_i" from 1 to _ran do { }; if (_unit == ace_player) then { ctrlSetText [1400,"Calling"]; - [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); + [LINKFUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); } else { private _explosive = [_code] call FUNC(getSpeedDialExplosive); if ((count _explosive) > 0) then { diff --git a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf index 8490eab452..0f4e5d923f 100644 --- a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf +++ b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf @@ -24,7 +24,6 @@ private _explosive = []; if ((_x select 1) == _code) exitWith { _explosive = _x; }; - false -} count GVAR(CellphoneIEDs); +} forEach GVAR(CellphoneIEDs); _explosive diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index ef9b686d25..7c7d5e58d4 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -22,6 +22,15 @@ TRACE_3("params",_explosive,_magazine,_trigger); private _config = ConfigFile >> "ACE_Triggers" >> _trigger; +// Make selected trigger the active one (for keybind) if it's the first to be connected +private _activeTrigger = GVAR(activeTrigger); +if ( + _activeTrigger == "" && + {(["Command", "MK16_Transmitter", "DeadManSwitch"] findIf {_x == _trigger}) != -1} +) then { + GVAR(activeTrigger) = getArray (_config >> "requires") select 0; +}; + // If the onSetup function returns true, it is handled elsewhere if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith { TRACE_2("onSetup returned true",_explosive,_trigger); diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 423e8932c3..918bbb0c33 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -161,7 +161,7 @@ GVAR(TweakedAngle) = 0; private _placeAngle = 0; private _expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition)); - TRACE_1("Planting Mass", (getMass _expSetupVehicle)); + TRACE_1("Planting Mass",(getMass _expSetupVehicle)); //If the object is too heavy, it can kill a player if it colides if ((getMass _expSetupVehicle) > 5) then {_expSetupVehicle setMass 5;}; diff --git a/addons/explosives/initKeybinds.inc.sqf b/addons/explosives/initKeybinds.inc.sqf new file mode 100644 index 0000000000..c01d39795c --- /dev/null +++ b/addons/explosives/initKeybinds.inc.sqf @@ -0,0 +1,50 @@ +#include "\a3\ui_f\hpp\defineDIKCodes.inc" + +["ACE3 Equipment", QGVAR(openCellphone), LLSTRING(cellphone_displayName), { + if ( + !([ACE_player, "ACE_Cellphone"] call EFUNC(common,hasItem)) || + !([ACE_player, objNull, ["isNotSwimming", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) + ) exitWith {}; + + closeDialog 0; + createDialog "Rsc_ACE_PhoneInterface"; + + true +}] call CBA_fnc_addKeybind; // Unbound + +["ACE3 Equipment", QGVAR(detonateActiveClacker), LLSTRING(DetonateAllOnActive), { + // Prevent use of keybind while surrendering or captive + if !([ACE_player, objNull, ["isNotSwimming", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; + + private _detonator = GVAR(activeTrigger); + if (_detonator == "" || !(_detonator in ([ACE_player] call FUNC(getDetonators)))) exitWith {}; + + // When using a Dead Man's Switch, skip all other logic and just call fnc_onIncapacitated, since it already handles everything that is required to detonate all connected explosives + if (_detonator == "ACE_DeadManSwitch") exitWith { + [ACE_player] call FUNC(onIncapacitated); + }; + + private _range = getNumber (configFile >> "CfgWeapons" >> _detonator >> QGVAR(Range)); + + private _explosivesList = []; + { + if (!isNull (_x select 0)) then { + private _required = getArray (configFile >> "ACE_Triggers" >> _x select 4 >> "requires"); + if (_detonator in _required) then { + _explosivesList pushBack _x; + }; + }; + } forEach ([ACE_player] call FUNC(getPlacedExplosives)); + + [ACE_player, _range, _explosivesList, _detonator] call FUNC(detonateExplosiveAll); + + true +}] call CBA_fnc_addKeybind; // Unbound + +["ACE3 Equipment", QGVAR(cycleActiveClacker), LLSTRING(CycleActiveTrigger), { + if !([ACE_player, objNull, ["isNotSwimming", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; + + [ACE_player] call FUNC(cycleActiveTrigger); + + true +}] call CBA_fnc_addKeybind; // Unbound diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 86c3183fe3..fccc685c4f 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -46,7 +46,7 @@ Robbantás Detonar Подрыв - 点火 + 起爆 폭파 引爆 引爆 @@ -62,12 +62,48 @@ Detona Tutti Tout détoner Detonar Tudo - すべて点火 + 全て起爆 모두 폭파 引爆全部 引爆全部 Hepsini Patlat + + Detonate All on Active Clacker + Alle auf Standardzünder zünden + Detona Tutti sul Detonatore Attivo + Подрыв всех на активном детонаторе + 選択した点火装置を全て起爆 + 활성화된 격발기의 모든 것을 폭파 + Détoner tout sur le détonateur actif + + + Set Active Clacker + Als Standardzünder wählen + Imposta Detonatore Attivo + Установить активный детонатор + この点火装置を選択 + 격발기 활성 설정 + Définir le détonateur actif + + + Cycle Active Clacker + Standardzünder wechseln + Cambia Detonatore Attivo + Цикл активного детонатора + 点火装置を切り替え + 격발기 활성 전환 + Modifier le détonateur actif + + + Active Clacker + Standardzünder + Detonatore Attivo + Активный детонатор + 選択中の点火装置 + 격발기 활성 + Détonateur actif + Explosive code: %1 Sprengstoffcode: %1 @@ -1134,7 +1170,7 @@ Minimum time value (in seconds) for the explosive timer. Минимальное время до взрыва в секундах Définit la durée minimale paramétrable sur le minuteur. - 起爆タイマーの最低時間 (秒) を設定します。 + 起爆タイマーの最短時間 (秒単位) を設定します。 Tiempo mínimo (en segundos) para el temporizador del explosivo. Minimalna wartość czasomierza dla ładunku (w sekundach). Minimale Zeit (in Sekunden) für den Zeitzünder. @@ -1147,7 +1183,7 @@ Maximum time value (in seconds) for the explosive timer. Макисмальное время до взрыва в секундах Définit la durée maximale paramétrable sur le minuteur. - 起爆タイマーの最長時間 (秒) を設定します。 + 起爆タイマーの最長時間 (秒単位) を設定します。 Tiempo máximo (en segundos) para el temporizador del explosivo. Maksymalna wartość czasomierza dla ładunku (w sekundach). Maximale Zeit (in Sekunden) für den Zeitzünder. @@ -1160,7 +1196,7 @@ Default time value (in seconds) for the explosive timer. Стандартное время до взрыва в секундах Définit la durée paramétrée par défaut sur le minuteur. - 起爆タイマーの標準時間 (秒) を設定します。 + 起爆タイマーの標準時間 (秒単位) を設定します。 Tiempo por defecto (en segundos) para el temporizador del explosivo. Domyślna wartość czasomierza dla ładunku (w sekundach). Standardmäßige Zeit (in Sekunden) für den Zeitzünder. diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 27d3ca4008..650b277dbf 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -1,11 +1,9 @@ #include "script_component.hpp" -[QGVAR(deployRopes), { - _this call FUNC(deployRopes); -}] call CBA_fnc_addEventHandler; +[QGVAR(deployRopes), LINKFUNC(deployRopes)] call CBA_fnc_addEventHandler; [QGVAR(startFastRope), { - [FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler; }] call CBA_fnc_addEventHandler; // Keybinds diff --git a/addons/fastroping/functions/fnc_cutRopes.sqf b/addons/fastroping/functions/fnc_cutRopes.sqf index cbd01b5661..40d2416049 100644 --- a/addons/fastroping/functions/fnc_cutRopes.sqf +++ b/addons/fastroping/functions/fnc_cutRopes.sqf @@ -34,8 +34,8 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; //Only delete the hook first so the rope falls down. //Note: ropeDetach was used here before, but the command seems a bit broken. deleteVehicle _hook; - [{{deleteVehicle _x} count _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute; -} count _deployedRopes; + [{{deleteVehicle _x} forEach _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute; +} forEach _deployedRopes; _vehicle setVariable [QGVAR(deployedRopes), [], true]; diff --git a/addons/fastroping/functions/fnc_deployRopes.sqf b/addons/fastroping/functions/fnc_deployRopes.sqf index 71cfbbbc21..eea81a7746 100644 --- a/addons/fastroping/functions/fnc_deployRopes.sqf +++ b/addons/fastroping/functions/fnc_deployRopes.sqf @@ -67,9 +67,7 @@ if (GVAR(requireRopeItems) && {_ropeClass != ""}) then { //deployedRopes format: attachment point, top part of the rope, bottom part of the rope, attachTo helper object, occupied, broken _deployedRopes pushBack [_ropeOrigin, _ropeTop, _ropeBottom, _dummy, _hook, false, false]; - - false -} count _ropeOrigins; +} forEach _ropeOrigins; _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; _vehicle setVariable [QGVAR(deploymentStage), 3, true]; diff --git a/addons/fastroping/functions/fnc_fastRope.sqf b/addons/fastroping/functions/fnc_fastRope.sqf index 80be870553..430c8d86ca 100644 --- a/addons/fastroping/functions/fnc_fastRope.sqf +++ b/addons/fastroping/functions/fnc_fastRope.sqf @@ -36,4 +36,4 @@ _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; //Start server PFH asap [QGVAR(startFastRope), [_unit, _vehicle, _usableRope, _usableRopeIndex, false]] call CBA_fnc_serverEvent; moveOut _unit; -[FUNC(fastRopeLocalPFH), 0, [_unit, _vehicle, _usableRope, _usableRopeIndex, diag_tickTime]] call CBA_fnc_addPerFrameHandler; +[LINKFUNC(fastRopeLocalPFH), 0, [_unit, _vehicle, _usableRope, _usableRopeIndex, diag_tickTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf index 92d23715b0..b1fec908a5 100644 --- a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf @@ -20,7 +20,7 @@ _arguments params ["_unit", "", "_rope", "", "_timeToPlayRopeSound"]; _rope params ["", "", "", "_dummy", "_hook"]; //Wait until the unit is actually outside of the helicopter -if (vehicle _unit != _unit) exitWith {}; +if (!isNull objectParent _unit) exitWith {}; // dummy lost hook if (isNull _hook) exitWith { diff --git a/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf b/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf index c3b7fe1ea4..716c0ab43e 100644 --- a/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeServerPFH.sqf @@ -20,7 +20,7 @@ _arguments params ["_unit", "_vehicle", "_rope", "_ropeIndex", "_hasBeenAttached _rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook"]; //Wait until the unit is actually outside of the helicopter -if (vehicle _unit != _unit) exitWith {}; +if (!isNull objectParent _unit) exitWith {}; //Prevent teleport if hook has been deleted due to rope cut if (isNull _hook) exitWith { diff --git a/addons/fastroping/functions/fnc_moduleEquipFRIES.sqf b/addons/fastroping/functions/fnc_moduleEquipFRIES.sqf index 970194ab63..892997bf80 100644 --- a/addons/fastroping/functions/fnc_moduleEquipFRIES.sqf +++ b/addons/fastroping/functions/fnc_moduleEquipFRIES.sqf @@ -22,5 +22,4 @@ private _synchedUnits = synchronizedObjects _module; _x = vehicle _x; }; [_x] call FUNC(equipFRIES); - false -} count _synchedUnits; +} forEach _synchedUnits; diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index ef613c633e..b68da23d28 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -324,6 +324,7 @@ FRIES 로프 자동 장착 Equipement automatique FRIES Auto-equipar FRIES + Авто-подготовка канатов Automatically add FRIES to helicopters that support them. @@ -334,6 +335,7 @@ 로프를 지원하는 헬기에 자동으로 FRIES 로프를 추가합니다. Ajoute automatiquement des FRIES aux hélicoptères qui les supportent. Adiciona automaticamente FRIES a helicópteros que os suportam. + Автоматически добавляйте канаты в вертолеты, которые их поддерживают. diff --git a/addons/fcs/functions/fnc_calculateSolution.sqf b/addons/fcs/functions/fnc_calculateSolution.sqf index 5800068e4b..b0cb2ea1c4 100644 --- a/addons/fcs/functions/fnc_calculateSolution.sqf +++ b/addons/fcs/functions/fnc_calculateSolution.sqf @@ -44,14 +44,13 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret if (_x != "this") then { _weaponMagazines append getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); }; - false - } count _muzzles; + } forEach _muzzles; // Fix the `in` operator being case sensitive and BI fucking up the spelling of their own classnames - private _weaponMagazinesCheck = _weaponMagazines apply {toLower _x}; + private _weaponMagazinesCheck = _weaponMagazines apply {toLowerANSI _x}; // Another BIS fix: ShotBullet simulation uses weapon initSpeed, others ignore it - if (toLower _magazine in _weaponMagazinesCheck && {_bulletSimulation == "shotBullet"}) exitWith { + if (toLowerANSI _magazine in _weaponMagazinesCheck && {_bulletSimulation == "shotBullet"}) exitWith { private _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); if (_initSpeedCoef < 0) then { @@ -62,8 +61,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret _initSpeed = _initSpeedCoef; }; }; - false - } count (_vehicle weaponsTurret _turret); + } forEach (_vehicle weaponsTurret _turret); private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; _offset = parseNumber _offset; @@ -72,8 +70,7 @@ private _turretConfig = [configOf _vehicle, _turret] call EFUNC(common,getTurret _FCSMagazines pushBack _magazine; _FCSElevation pushBack _offset; }; - false -} count (_vehicle magazinesTurret _turret); +} forEach (_vehicle magazinesTurret _turret); [_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(InitSpeed), _turret], _FCSInitSpeed] call EFUNC(common,setVariablePublic); diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index dedef1c74e..e99416593a 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []]; @@ -50,7 +50,7 @@ if (_zeroDistance > 0) then { private _antiOffset = _gunner getVariable QGVAR(lastAntiOffset); _offset = _offset - _antiOffset; - TRACE_4("fired",_gunner, currentZeroing _gunner, _antiOffset, _offset); + TRACE_4("fired",_gunner,currentZeroing _gunner,_antiOffset,_offset); }; [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); @@ -72,5 +72,5 @@ if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(Airburst)) == 1) then { if (_zeroing < 50) exitWith {}; if (_zeroing > 1500) exitWith {}; - [FUNC(handleAirBurstAmmunitionPFH), 0, [_vehicle, _projectile, _zeroing]] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(handleAirBurstAmmunitionPFH), 0, [_vehicle, _projectile, _zeroing]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/fcs/stringtable.xml b/addons/fcs/stringtable.xml index dd0c20922f..2f3ae894b1 100644 --- a/addons/fcs/stringtable.xml +++ b/addons/fcs/stringtable.xml @@ -44,7 +44,7 @@ Ajustar distância do FCS (Acima) Aumenta la portata dell'FCS Диапазон СУО (выше) - FCS による距離を調節 (上げ) + FCS 距離を調節 (上げ) 사통장치 거리 조정 (위로) 调整火控系统距离(上调) 調整火控系統距離 (上) @@ -60,7 +60,7 @@ Ajustar distância do FCS (Abaixo) Riduci la portata dell'FCS Диапазон СУО (ниже) - FCS による距離を調節 (下げ) + FCS 距離を調節 (下げ) 사통장치 거리 조정 (아래로) 调整火控系统距离(下调) 調整火控系統距離 (下) diff --git a/addons/field_rations/XEH_postInit.sqf b/addons/field_rations/XEH_postInit.sqf index 1ee235ca4f..9f64379094 100644 --- a/addons/field_rations/XEH_postInit.sqf +++ b/addons/field_rations/XEH_postInit.sqf @@ -96,7 +96,7 @@ if !(hasInterface) exitWith {}; ] call CBA_fnc_addItemContextMenuOption; // Add water source helpers when interaction menu is opened - ["ace_interactMenuOpened", {call FUNC(addWaterSourceInteractions)}] call CBA_fnc_addEventHandler; + ["ace_interactMenuOpened", LINKFUNC(addWaterSourceInteractions)] call CBA_fnc_addEventHandler; // Add status modifiers if (["ace_medical"] call EFUNC(common,isModLoaded)) then { @@ -134,7 +134,7 @@ if !(hasInterface) exitWith {}; ["CAManBase", "respawn", LINKFUNC(handleRespawn)] call CBA_fnc_addClassEventHandler; // Start update loop - [FUNC(update), CBA_missionTime + MP_SYNC_INTERVAL, 1] call CBA_fnc_waitAndExecute; + [LINKFUNC(update), CBA_missionTime + MP_SYNC_INTERVAL, 1] call CBA_fnc_waitAndExecute; #ifdef DEBUG_MODE_FULL ["ACE_player thirst", {ACE_player getVariable [QXGVAR(thirst), 0]}, [true, 0, 100]] call EFUNC(common,watchVariable); diff --git a/addons/field_rations/XEH_preStart.sqf b/addons/field_rations/XEH_preStart.sqf index 88109cf9ee..ebb22b6ee8 100644 --- a/addons/field_rations/XEH_preStart.sqf +++ b/addons/field_rations/XEH_preStart.sqf @@ -15,7 +15,7 @@ private _waterSourceOffsets = [ // Fill water source arrays from CfgVehicles { private _split = (getText (_x >> "model")) splitString "\"; - private _string = toLower (_split param [((count _split) - 1), ""]); + private _string = toLowerANSI (_split param [((count _split) - 1), ""]); // Append extension if necessary if ((_string select [count _string - 4]) != ".p3d") then { diff --git a/addons/field_rations/functions/fnc_update.sqf b/addons/field_rations/functions/fnc_update.sqf index 82b87bcfb6..f66573824b 100644 --- a/addons/field_rations/functions/fnc_update.sqf +++ b/addons/field_rations/functions/fnc_update.sqf @@ -25,7 +25,7 @@ private _player = ACE_player; // Exit if player is not alive or a virtual unit if (!alive _player || {_player isKindOf "VirtualMan_F"}) exitWith { - [FUNC(update), _nextMpSync, 1] call CBA_fnc_waitAndExecute; + [LINKFUNC(update), _nextMpSync, 1] call CBA_fnc_waitAndExecute; QGVAR(hud) cutFadeOut 0.5; }; @@ -73,4 +73,4 @@ if (!EGVAR(common,OldIsCamera) && {_thirst > XGVAR(hudShowLevel) || {_hunger > X QGVAR(hud) cutFadeOut 0.5; }; -[FUNC(update), _nextMpSync, 1] call CBA_fnc_waitAndExecute; +[LINKFUNC(update), _nextMpSync, 1] call CBA_fnc_waitAndExecute; diff --git a/addons/field_rations/stringtable.xml b/addons/field_rations/stringtable.xml index 8a513a2926..2b443ccc3c 100644 --- a/addons/field_rations/stringtable.xml +++ b/addons/field_rations/stringtable.xml @@ -31,6 +31,7 @@ ACE 전투식량 HUD ACE HUD de Raciones de campo ACE HUD de Rações de Campo + ACE Rations de terrain HUD Indicates current hunger and thirst status. @@ -78,6 +79,7 @@ 먹기/마시기 Comer/Beber Comer/Beber + Manger/Boire Enable/Disable Field Rations @@ -177,6 +179,7 @@ 갈증 해소 Sed saciada Sede saciada + Soif étanchée Coefficient for the amount of thirst quenched from drinking. @@ -191,6 +194,7 @@ 마심으로써 갈증이 얼마나 해소되는지를 정합니다 Coeficiente del saciamiento de sed por beber. Coeficiente para a quantidade de sede saciada por beber. + Coefficient déterminant la quantité de soif étanchée par la boisson. Hunger Satiated @@ -205,6 +209,7 @@ 배부름 Hambre saciada Fome saciada + Faim rassasiée Coefficient for the amount of hunger satiated from eating. @@ -219,6 +224,7 @@ 밥을 먹어서 배고픔이 얼마나 해결되는지를 정합니다 Coeficiente del saciamiento del hambre por comer. Coeficiente para a quantidade de fome saciada por comer. + Coefficient déterminant la quantité de faim satisfaite en mangeant. Water Source Actions @@ -232,6 +238,7 @@ 물 근처 행동 Acciones para suministros de agua Ações para suprimentos de água + Interactions sur les sources d'eau Controls what actions are available on water sources. @@ -245,6 +252,7 @@ 물가에서 어떤 행동을 취할지 정합니다 Controla qué acciones están disponibles para los suministros de agua. Controla quais ações estão disponíveis para os suprimentos de água. + Déterminer les stocks disponibles dans les sources d'eau. Refill Only @@ -258,6 +266,7 @@ 다시 채우기만 가능 Sólo rellenar Apenas reabastecer + Remplissage uniquement Terrain Object Actions @@ -271,6 +280,7 @@ 지형 물체 상호작용 Acciones sobre objetos del terreno Ações para objetos do terreno + Actions sur les objets du terrain Enables water source actions for terrain objects. @@ -284,6 +294,7 @@ 지형 물체에서 물을 얻는 게 가능해집니다. Habilitar acciones de suministros de agua para los objetos en el suelo. Habilita ações para suprimentos de água para objetos do terreno. + Active les actions relatives aux sources d'eau pour les objets de terrain. Affect Advanced Fatigue @@ -298,6 +309,7 @@ 고급 피로도에 영향을 끼침 Afecta a la Fatiga Avanzada Afeta a Fadiga Avançada + Affectation Fatigue avancée Controls if thirst and hunger should affect ACE Advanced Fatigue. @@ -312,6 +324,7 @@ 배고픔과 목마름이 고급 피로도에 영향을 끼칠지를 정합니다 Controla si la sed y el hambre afectan a la Fatiga Avanzada de ACE Controla se a sede e a fome afetam a Fadiga Avançada do ACE. + Contrôle si la soif et la faim doivent affecter la fatigue avancée ACE. HUD Type @@ -326,6 +339,7 @@ HUD 종류 Tipo de HUD Tipo de HUD + Type de HUD Selects which HUD style will be used. @@ -340,6 +354,7 @@ 사용될 HUD 스타일을 고르십시오. Selecciona qué estilo de HUD será utilizado. Seleciona qual estilo de HUD será usado. + Sélectionne le style HUD à utiliser. Colored Icons @@ -354,6 +369,7 @@ 색깔 아이콘 Iconos coloreados Ícones coloridos + Icônes de couleur Draining Icons @@ -368,6 +384,7 @@ 빠지는 아이콘 Iconos de drenado Ícones de drenagem + Icônes incolores HUD Show Level @@ -382,6 +399,7 @@ HUD 표시 Mostrar nivel en HUD Mostrar nível no HUD + Afficher le niveau dans le HUD Automatically show the HUD when either thirst or hunger are above this level. @@ -396,6 +414,7 @@ 정한 퍼센트 이하로 내려가면 HUD가 나타나게 합니다. Mostrar automáticamente el HUD cuando la sed o el hambre están por encima de este nivel. Mostrar automaticamente o HUD quando a sede ou a fome estão acima deste nível. + Affiche automatiquement le HUD dès que la soif ou la faim sont au-dessus de ce niveau. Always @@ -427,6 +446,7 @@ 색깔 아이콘 - 투명도 Iconos coloreados - Transparencia Ícones coloridos - Transparência + Icônes de couleur - Transparence Controls the transparency of the Colored Icons HUD. Dynamic setting makes the HUD less transparent as thirst or hunger increase. @@ -435,12 +455,13 @@ 控制顏色化圖示的透明度。設定為動態使其界面透明度與飲食需求一樣,越透明越需要。 控制彩色图标 HUD 的透明度。动态设置使 HUD 的透明度随着口渴或饥饿的增加而减弱。 Kontroluje transparentność kolorowych ikon HUD. Dynamiczne ustawienie zmniejsza przejrzystość wraz z zwiększeniem głodu czy pragnienia. - 色付きアイコンの透明度を決定できます。動的に設定されると、空腹度や喉の渇きが増すにつれて、アイコンの透明度を下げます。 + 色付きアイコンの透明度を制御できます。動的に設定されると、空腹度や喉の渇きが増すにつれて、アイコンの透明度を下げます。 Настраивает прозрачность цветных иконок. «Динамическая» делает иконки менее прозрачными при увеличении жажды и голода. Renkli Simgeler Gösterge Paneli'nin şeffaflığını kontrol eder. Dinamik ayar, susuzluk veya açlık arttıkça HUD'yi daha az şeffaf hale getirir. 색깔 아이콘의 투명도를 조절합니다. 동적 설정의 경우 배고픔이나 목마름이 해결되면 덜 투명하게 바뀝니다. Controla la transparencia de los Iconos coloreados en el HUD. La opción dinámica muestra el HUD menos transparente cuando la sed o el hambre aumentan. Controla a transparência dos ícones coloridos no HUD. A configuração dinâmica torna o HUD menos transparente à medida que a sede ou a fome aumentam. + Contrôle la transparence du HUD des icônes colorées. Un réglage dynamique rend le HUD moins transparent lorsque la soif ou la faim augmentent. Dynamic @@ -465,12 +486,13 @@ Scorta d'acqua 飲用水補給 饮用水补给 - 水資源 + 水資源量 Водные ресурсы Źródło wody 식수 보급량 Suministro de agua Suprimentos de água + Réserve d'eau The amount of water available for ACE Field Rations water source actions (-1 disabled, -10 infinite) @@ -478,12 +500,13 @@ La quantità di acqua disponibile per interazioni ACE Razioni da Campo di sorgenti d'acqua (-1 nessuna, -10 infinita) 水源可供補充飲用水的次數(-1為關閉,-10為無限次)。 水源可供取水的次数(-1为关闭,-10为无限次)。 - ACE フィールド レーションで利用できる水源の量を設定できます。(-1で無効化、-10で無限) + ACE フィールド レーションで利用できる水源の資源量を設定できます。(-1で無効化、-10で無限) Количество воды, доступной для использования в ACE Полевые рационы. (-1 - отключено, -10 - бесконечно) Ilość wody dostępnej dla Akcji ACE Źródła wody (-1 wyłączone, -10 nieskończone) ACE 전투식량 물 근처 행동에서 얼마나 물을 얻어 갈 수 있는지를 정합니다 (-1은 비활성화, -10은 무한대) La cantidad de agua disponible para las acciones de suministro de agua de las Raciones de Combate de ACE (-1 deshabilitado, -10 infinito) A quantidade de água disponível para as ações de suprimentos de água das Rações de Campo do ACE (-1 desativado, -10 infinito) + Quantité d'eau disponible pour les actions relatives aux sources d'eau des rations de campagne ACE (-1 désactivé, -10 infini). Water Source @@ -498,6 +521,7 @@ 수원지 Suministro de agua Fonte de água + Source d'eau Check Remaining Water @@ -512,6 +536,7 @@ 남은 물 확인 Comprobar agua restante Verificar água restante + Vérifier l'eau restante Checking remaining water... @@ -526,6 +551,7 @@ 남은 물 확인 중... Comprobando agua restante... Verificando água restante... + Vérification de l'eau restante... There are %1 litres left. @@ -540,6 +566,7 @@ %1 리터의 물이 남아있습니다. Quedan %1 litros. Ainda há %1 litros. + Il reste %1 litres. There is no water left. @@ -554,6 +581,7 @@ 물이 한 방울도 없습니다. No queda agua. Não há mais água. + Il n'y a plus d'eau. Drink From Source @@ -567,6 +595,7 @@ 수원에서 물 마시기 Beber desde el suministro Beber da fonte + Boire à la source Refill @@ -632,6 +661,7 @@ %1 먹는 중... Comiendo %1... Comendo %1... + Manger %1... Drinking %1... @@ -646,6 +676,7 @@ %1 마시는 중... Bebiendo %1... Bebendo %1... + Boire %1... Drinking from %1... @@ -660,6 +691,7 @@ %1 으로 부터 마시는 중... Bebiendo desde %1... Bebendo de %1... + Boire à %1... Drinking from source... @@ -673,6 +705,7 @@ 수원에서 마시는 중... Bebiendo desde el suministro... Bebendo da fonte... + Boire à la source... Water Bottle @@ -891,6 +924,7 @@ 상쾌한 레몬라임향의 탄산음료 Bebida refrescante de sabor lima y limón Bebida refrescante de sabor limão e lima + Une boisson gazeuse rafraîchissante au goût de citron et de citron vert. Orange flavored soft drink with a tingly, fruity taste @@ -905,6 +939,7 @@ 오렌지 향의 톡쏘는 탄산음료 Bebida refrescante de sabor naranja, con un chispeante y afrutado sabor. Bebida refrescante de sabor laranja, com um sabor frutado e formigante. + Une boisson gazeuse aromatisée à l'orange Red Gull gives you wings @@ -919,6 +954,7 @@ 레드굴은 날개를 달아줘요 Red Gull te da alas Red Gull te dá asas + Red Gull vous donne des ailes MRE Lamb Curry @@ -967,6 +1003,7 @@ MRE 비프스튜 MRE Estofado de ternera MRE ensopado de carne + MRE Ragoût de bœuf An MRE containing Beef Stew. Heat for best effect @@ -981,6 +1018,7 @@ 비프스튜가 들어있는 MRE입니다. 뜨겁게 먹을 때 가장 좋습니다 Un MRE que contiene estofado de ternera. Calentar para mejor efecto. Um MRE contendo ensopado de carne. Aquecer para melhor efeito + Un MRE contenant du ragoût de bœuf. Chauffer pour un meilleur effet MRE Cream Tomato Soup @@ -1229,6 +1267,7 @@ Семечки подсолнуха Pipas de girasol Sementes de girassol + Graines de tournesol Roasted And Salted @@ -1241,6 +1280,7 @@ Поджаренные и солёные Tostadas y saladas Torradas e salgadas + Grillé et salé diff --git a/addons/fieldmanual/CfgHints.hpp b/addons/fieldmanual/CfgHints.hpp index 8164bd7943..6f5b0c8efe 100644 --- a/addons/fieldmanual/CfgHints.hpp +++ b/addons/fieldmanual/CfgHints.hpp @@ -37,7 +37,7 @@ class CfgHints { }; class ACE_BodyBag: ACE_FieldManual_Base { logicalOrder = 2; - arguments[] = {BASE_ARGUMENTS, QUOTE('ACE_BodyBag' call FUNC(getItemName))}; + arguments[] = {BASE_ARGUMENTS, QUOTE('ACE_BodyBag' call FUNC(getItemName)), MEDICAL_MENU_KEYBIND}; displayName = "%14"; displayNameShort = CSTRING(Items_BodyBag_ShortName); description = CSTRING(Items_BodyBag_Description); @@ -122,7 +122,7 @@ class CfgHints { }; class ACE_FortifyTool: ACE_FieldManual_Base { logicalOrder = 13; - arguments[] = {BASE_ARGUMENTS, QUOTE('ACE_FortifyTool' call FUNC(getItemName))}; + arguments[] = {BASE_ARGUMENTS, QUOTE('ACE_Fortify' call FUNC(getItemName))}; displayName = "%14"; displayNameShort = CSTRING(Items_FortifyTool_ShortName); description = CSTRING(Items_FortifyTool_Description); diff --git a/addons/fieldmanual/stringtable.xml b/addons/fieldmanual/stringtable.xml index 1def57aeb9..05c7414f17 100644 --- a/addons/fieldmanual/stringtable.xml +++ b/addons/fieldmanual/stringtable.xml @@ -26,6 +26,8 @@ Fame Hunger 空腹 + Голод + Faim %3Hunger%4 increases linearly with soldier's movement speed. Restore by eating food.<br/><br/>%3Usage:%4<br/>%2Pick up food.<br/>%2Use [%3%12%4] and select %3Survival%4.<br/>%2Choose an item to consume. @@ -35,6 +37,8 @@ %3Hunger%4 steigt linear mit der Bewegungsgeschwindigkeit des Soldaten. Regeneriert sich, indem Nahrung zu sich genommen wird.<br/><br/>%3Verwende:%4<br/>%2Nahrung einsammeln.<br/>%2Verwende [%3%12%4] und wählen %3Überleben%4.<br />%2Wähle einen Gegenstand zum Verzehr aus. %3Fame%4 aumenta linearmente con la velocità di movimento del soldato. Si rigenera consumando cibo.<br/><br/>%3Usa:%4<br/>%2Raccogli cibo.<br/>%2Usa [%3%12%4] e scegli %3sopravvivenza%4.<br />%2Scegli un articolo da mangiare. %3空腹度%4は兵士の移動速度に比例して増加します。食べ物を食べることで回復します。<br/><br/>%3使用方法:%4<br/>%2食べ物を持つ。<br/>%2[%3%12%4] を使って%3サバイバル%4を選択。<br/>%2食べたいものを選ぶ。 + %3Голод%4 линейно увеличивается со скоростью передвижения солдата. Восстанавливайтесь, употребляя пищу.<br/><br/>%3 Использование:%4<br/>%2Возьмите еду.<br/>%2Используйте [%3%12%4] и выберите %3Выживание% 4.<br/>%2Выберите продукт для потребления. + %3La faim%4 augmente linéairement avec la vitesse de déplacement du soldat. Il se régénère en consommant de la nourriture.<br/><br/>%3Utilisation:%4<br/>%2Ramasser la nourriture.<br/>%2Utilisez [%3%12%4] et sélectionnez %3Survie%4.<br/>%2Choisissez un article à consommer. Thirst @@ -44,6 +48,8 @@ Sete Durst 渇き + Жажда + Soif %3Thirst%4 increases linearly with soldier's movement speed. Restore by drinking liquids.<br/><br/>%3Usage:%4<br/>%2Pick up a drink.<br/>%2Use [%3%12%4] and select %3Survival%4.<br/>%2Choose an item to consume. @@ -53,6 +59,8 @@ %3Durst%4 steigt linear mit der Bewegungsgeschwindigkeit des Soldaten. Regeneriert sich durch das Trinken von Flüssigkeiten.<br/><br/>%3Verwende:%4<br/>%2Holen ein Getränk.<br/>%2Verwende [%3%12%4] und wähle %3Überleben%4.< br/>%2Wähle einen Gegenstand zum Verzehr aus. %3Sete%4 aumenta linearmente con la velocità di movimento del soldato. Si rigenera bevendo liquidi.<br/><br/>%3Usa:%4<br/>%2Raccogli bevanda.<br/>%2Usa [%3%12%4] e scegli %3sopravvivenza%4.<br />%2Scegli un articolo da bere. %3喉の渇き%4は兵士の移動速度に比例して増加します。飲み物を飲むことで回復します。<br/><br/>%3使用方法:%4<br/>%2飲み物を持つ。<br/>%2[%3%12%4] を使って%3サバイバル%4を選択。<br/>%2飲みたいものを選ぶ。 + %3Жажда%4 линейно увеличивается со скоростью передвижения солдата. Восстанавливайтесь, употребляя напитки.<br/><br/>%3 Использование:%4<br/>%2Возьмите напиток.<br/>%2Используйте [%3%12%4] и выберите %3Выживание% 4.<br/>%2Выберите напиток для потребления. + %3La soif%4 augmente linéairement avec la vitesse de déplacement du soldat. Elle se régénère en buvant des liquides.<br/><br/>%3Utilisez [%3%12%4] et choisissez %3survival%4.<br />%2Choisissez un article à boire. Medical Treatment @@ -62,6 +70,8 @@ Medizinische Behandlung Cure Mediche 治療 + Медицинское лечение + Traitement médical Decrease Heart Rate @@ -71,6 +81,8 @@ Verringere Herzfrequenz Rallenta ritmo cardiaco 心拍数を下げる + Уменьшить частоту сердечных сокращений + Diminution de la fréquence cardiaque %3Adenosine%4 is used to decrease heart rate.<br/><br/>%3Usage:%4<br/>%2Use [%3%13%4] or [%3%14%4] and select an appendage.<br/>%2Inject %3Adenosine%4. @@ -80,6 +92,8 @@ %3Adenosin%4 wird verwendet, um die Herzfrequenz zu senken.<br/><br/>%3Verwende:%4<br/>%2Verwende [%3%13%4] oder [%3%14%4] und wählen ein Körperteil aus.<br/>%2Injiziere %3Adenosin%4. %3Adenosina%4 è usata per rallentare il ritmo cardiaco.<br/><br/>%3Utilizzo:%4<br/>%2Usa [%3%13%4] o [%3%14%4] e seleziona un arto.<br/>%2Inject %3Adenosina%4. %3アデノシン%4は心拍数を下げるのに使われます。<br/><br/>%3使用方法:%4<br/>%2[%3%13%4] または [%3%14%4] を使って四肢を選択します。<br/>%2そして%3アデノシン%4を注射します。 + %3Аденозин%4 используется для снижения частоты сердечных сокращений.<br/><br/>%3Применение:%4<br/>%2Используйте [%3%13%4] или [%3%14%4] и выберите конечность.<br/>%2Введите %3Аденозин%4. + L'%3adénosine%4 est utilisée pour réduire la fréquence cardiaque.<br/><br/>%3Utilisation:%4<br/>%2Utilisez [%3%13%4] ou [%3%14%4] et sélectionnez un membre.<br/>%2Injectez l'%3Adénosine%4. Bandages @@ -89,6 +103,8 @@ Bandagen Bende 包帯 + Бинты + Pansements Close Wounds @@ -98,6 +114,8 @@ Wunden schließen Chiudi ferite 傷口をふさぐ + Закрыть раны + Fermer les plaies %3Bandages%4 stop bleeding and close wounds. Depending on your settings, bandages may reopen if surgery is not performed.<br/><br/>%2%3Field Dressing:%4<br/>%11<t color='#D9D900'>Average</t> In All Categories<br/>%2%3Packing Bandage:%4<br/>%11<t color='#D9D900'>Average</t> Treatment<br/>%11<t color='#E60000'>Higher</t> Reopen Chance<br/>%11<t color='#00CC00'>Longer</t> Reopen Delay<br/>%2%3Elastic Bandage:%4<br/>%11<t color='#00CC00'>Higher</t> Treatment<br/>%11<t color='#E60000'>Higher</t> Reopen Chance<br/>%11<t color='#E60000'>Shorter</t> Reopen Delay<br/>%2%3Quickclot:%4<br/>%11<t color='#E60000'>Lower</t> Treatment<br/>%11<t color='#00CC00'>Lower</t> Reopen Chance<br/>%11<t color='#00CC00'>Longer</t> Reopening Delay<br/><br/>%3Usage:%4<br/>%2Use [%3%13%4] or [%3%14%4] and select a injured body part.<br/>%2Bandage body part by selecting desired %3Bandage%4 type. @@ -116,6 +134,7 @@ IV-Flüssigkeiten Fluidi EV IV 輸液 + IV Fluides Restore Blood Volume @@ -125,6 +144,8 @@ Blutvolumen wiederherstellen Ristorano Volume di Sangue 血液量を回復する + Внутривенные жидкости + Restaurer le volume sanguin %3IV fluids%4 restore lost blood volume. Blood, Plasma, and Saline are functionally the same.<br/><br/>%3Usage:%4<br/>%2Use [%3%13%4] or [%3%14%4] and select an appendage.<br/>%2Restore blood volume by selecting desired %3IV Fluid%4 type. @@ -134,6 +155,7 @@ %3IV-Flüssigkeiten%4 stellen das verlorene Blutvolumen wieder her. Blut, Plasma und Kochsalzlösung sind funktionell gleich.<br/><br/>%3Verwende:%4<br/>%2Verwende [%3%13%4] oder [%3%14%4] und wählen ein Körperteil aus..<br/>%2Stelle das Blutvolumen wieder her, indem der gewünschte %3IV Flüssigkeitstyp%4 ausgewählt wird. %3Fluidi EV%4 ristorano volume di sangue perso. Sangue, Plasma, e Salina sono funzionalmente identiche.<br/><br/>%3Utilizzo:%4<br/>%2Usa [%3%13%4] o [%3%14%4] e seleziona un arto.<br/>%2Ristora il volume di sangue selezionando il tipo di %3Fluido EV%4 desiderato. %3IV 輸液%4は失われた血液を回復します。血液、血漿、生理食塩水は機能的には同じです。<br/><br/>%3使用方法:%4<br/>%2[%3%13%4] または [%3%14%4] を使って四肢を選択します。<br/>%2希望の%3IV 輸液%4の種類を選択して、血液量を復元します。 + %%3Внутривенные жидкости%4восстанавливают потерянный объем крови. Кровь, плазма и физраствор функционально идентичны.<br/><br/>%3 Использование:%4<br/>%2 Используйте [%3%13%4] или [%3%14%4] и выберите добавку.<br/>%2 Восстановите объем крови выбрав желаемый %4тип %3жидкости Increase Heart Rate | Wake Up Faster @@ -143,6 +165,8 @@ Herzfrequenz erhöhen | Wache schneller auf Aumenta ritmo cardiaco | Accelera rinvenimento 心拍数を上げる | はやく起こす + Увеличьте частоту сердечных сокращений | просыпайтесь быстрее + Augmentation de la fréquence cardiaque - Réveil plus rapide %3Epinephrine%4 increases a patient's pulse as well as potentially decreasing the time between consciousnesss checks (effectively reducing the time needed for the patient to wake up).<br/><br/>%3Usage%4<br/>%2Use [%3%13%4] or [%3%14%4] and select an appendage.<br/>%2Inject %3Epinephrine%4. @@ -161,6 +185,8 @@ Wie neu wiederherstellen Cura completa 生まれたてのように回復する + Лечение тела + Remettre comme neuf The %3Personal Aid Kit%4 is an item that allows a soldier to be fully healed. Independent of %3ACE Settings%4, it requires that the patient is in %3Stable Condition%4 before use.<br/><br/>%3Stable Condition%4 qualifies as:<br/>%2Unit is %3Alive%4.<br/>%2Unit is %3Conscious%4.<br/>%2Unit has no active %3Bleeding%4.<br/>%2Heart Rate >= 40.<br/>%2Systolic BP >= 60.<br/>%2Diastolic BP >= 50.<br/><br/>%3Usage:%4<br/>%2Move to appropriate location depending on %3ACE Settings%4.<br/>%2Use [%3%13%4] or [%3%14%4] and select %3Advanced Treatments%4<br/>%2Select %3Use Personal Aid Kit%4. @@ -179,6 +205,8 @@ Brüche richten Risolvi frattura 骨折を治す + Исправлять переломы + Réparation des fractures A %3Splint%4 is used to fix fractures. The %3Splint%4 is consumed when used.<br/><br/>%3Usage:%4<br/>%2Use [%3%13%4] or [%3%14%4] and select an affected appendage.<br/>%2Select %3Apply Splint%4. @@ -196,6 +224,8 @@ Prevenir Reabertura de Feridas Impedisce la riapertura di ferite 傷口が開くのを防ぐ + Предотвратить повторное открытие ран + Empêcher la réouverture des plaies A %3Surgical Kit%4 is used to prevent wounds from reopening after being bandaged. Depending on settings, it can also clear trauma and may require additional %3Sutures%4 to close wounds. Sutures are consumable, much like bandages, and are not a replacement for the Surgical Kit.<br/><br/>%3Usage:%4<br/>%2Use [%3%13%4] or [%3%14%4] and select %3Advanced Treatment%4.<br/>%2Select %3Use Surgical Kit%4. @@ -212,6 +242,8 @@ Parar o Sangramento Ferma emorragia 出血を止める + Остановить кровотечение + Arrêter les saignements A %3Tourniquet%4 stops bleeding temporarily so that a wound(s) can be bandaged. Can only be used on limbs.<br/><br/>%3Usage:%4<br/>%2Use [%3%13%4] or [%3%14%4] and select an affected appendage.<br/>%2Select %3Apply Tourniquet%4. @@ -244,6 +276,7 @@ Cure, Semplificato Tratamento, Simplificado 治療を簡略化する + Traitement, simplifié The %3Medical Menu%4 is a dedicated %3interface%4 to facilitate %3medical treatment%4. The %3R%4 and %3L%4 letters indicate the side of the patient's body being treated.<br/><br/>%3Usage:%4<br/>%2Use [%3%14%4] while looking at a patient to open the Medical Menu. Opening the menu without a patient allows for self-treatment.<br/>%2Alternatively, use [%3%12%4] or [%3%13%4] and select %3Medical Menu%4.<br/><br/>%3Keybinds:%4<br/>%2Use [%3W, A, S, D, X, and Z%4] to select body parts.<br/>%2Use your %3number keys%4 to select treatment categories. @@ -260,6 +293,7 @@ Portátil, Preciso e Robusto Leggero, Preciso, Robusto 高機動、高精度、高耐久 + Portable, précis, robuste The %3Horus ATragMX%4 considers atmospheric conditions, gun data, ammunition, range, speed, and muzzle velocity to calculate precise aiming solutions with %3Come-Up%4 results - and even accounts for %3Coriolis%4 and %3Spin Drift%4 effects. %3ATragMX%4, loaded on a handheld computer made by %3TDS Recon%4, is easy to use and lightning fast. The %3Recon%4 meets the rigorous %3MIL-STD-810F%4 military standard for drops, vibration, humidity, altitude and extreme temperatures.<br/><br/>%3Usage:%4<br/>Please visit the wiki page for more information. @@ -276,14 +310,15 @@ Retorne os Abatidos Recupera i tuoi morti 死者を連れ出す + Récupérez vos morts - %3Body Bags%4 are used to transport dead bodies. They can be dragged and loaded into vehicles.<br/><br/>%3Usage:%4<br/>%2Approach a dead body.<br/>%2Use [%3%13%4] or [%3%14%4] and select %3Place Body In Bodybag%4. - %3Worki na Zwłoki%4 są używane do transportu ciał. Worki mogą być przeciągane i ładowanie do pojazdów.<br/><br/>%3Użycie:%4<br/>%2Podejdź do martwego ciała.<br/>%2Użyj [%3%13%4] lub [%3%14%4] i wybierz %3Umieść Ciało w Worku na Zwłoki%4. - %3시체 운반용 부대%4는 시체를 운반하는 데 사용되며, 차량으로 끌고 가서 적재할 수 있습니다.<br/><br/>%3사용 방법:%4<br/>%2시체에 접근하십시오.<br/>%2[%3%13%4] 또는 [%3%14%4]를 사용하여 %3시체 운반용 부대에 담기%4를 선택하십시오. - OS %3Sacos de Cadáver%4 são utilizados para transportar cadáveres. Eles podem ser arrastados e embarcados em veículos.<br/><br/>%3Uso:%4<br/>%2Aproxime-se de um cadáver.<br/>%2Utilize [%3%13%4] ou [%3%14%4] e selecione %3Colocar cadáver dentro do saco%4. - %3Sacche per cadaveri%4 sono usate per trasportare i morti. Possono essere trascinate e caricate su veicoli.<br/><br/>%3Utilizzo:%4<br/>%2Avvicinati ad un morto.<br/>%2Usa [%3%13%4] o [%3%14%4] e seleziona %3Metti il corpo nella sacca per cadaveri%4. - %3遺体袋%4は、遺体の輸送に使用されます。引きずって車両に積み込むことができます。<br/><br/>%3使用方法:%4<br/>%2遺体に近寄る。<br/>%2[%3%13%4] または [%3%14%4] を使って%3遺体袋に入れる%4を選択して使用します。 + %3Body Bags%4 are used to transport dead bodies. They can be dragged and loaded into vehicles.<br/><br/>%3Usage:%4<br/>%2Approach a dead body.<br/>%2Use [%3%13%4] or [%3%15%4] and select %3Place Body In Bodybag%4. + %3Worki na Zwłoki%4 są używane do transportu ciał. Worki mogą być przeciągane i ładowanie do pojazdów.<br/><br/>%3Użycie:%4<br/>%2Podejdź do martwego ciała.<br/>%2Użyj [%3%13%4] lub [%3%15%4] i wybierz %3Umieść Ciało w Worku na Zwłoki%4. + %3시체 운반용 부대%4는 시체를 운반하는 데 사용되며, 차량으로 끌고 가서 적재할 수 있습니다.<br/><br/>%3사용 방법:%4<br/>%2시체에 접근하십시오.<br/>%2[%3%13%4] 또는 [%3%15%4]를 사용하여 %3시체 운반용 부대에 담기%4를 선택하십시오. + OS %3Sacos de Cadáver%4 são utilizados para transportar cadáveres. Eles podem ser arrastados e embarcados em veículos.<br/><br/>%3Uso:%4<br/>%2Aproxime-se de um cadáver.<br/>%2Utilize [%3%13%4] ou [%3%15%4] e selecione %3Colocar cadáver dentro do saco%4. + %3Sacche per cadaveri%4 sono usate per trasportare i morti. Possono essere trascinate e caricate su veicoli.<br/><br/>%3Utilizzo:%4<br/>%2Avvicinati ad un morto.<br/>%2Usa [%3%13%4] o [%3%15%4] e seleziona %3Metti il corpo nella sacca per cadaveri%4. + %3遺体袋%4は、遺体の輸送に使用されます。引きずって車両に積み込むことができます。<br/><br/>%3使用方法:%4<br/>%2遺体に近寄る。<br/>%2[%3%13%4] または [%3%15%4] を使って%3遺体袋に入れる%4を選択して使用します。 Take Prisoners @@ -292,6 +327,7 @@ Faça Prisioneiros Prendi prigionieri 捕虜の捕り方 + Faire des prisonniers %3Cable Ties%4 enable a soldier to capture and detain another soldier. Once apprehended, the captor gains the ability to inspect the prisoner's belongings, set them free, or accompany them to an alternate area. Transporting escorted prisoners is also possible, including loading them into vehicles if needed. Depending on your settings, units may need to surrender before being taken captive.<br/><br/>%3Usage:%4<br/>%2Approach the unit and use the [%3%13%4].<br/>%2The interaction is located around the hands in the form of a handcuffs icon.<br/>%2Repeat to release. @@ -308,6 +344,7 @@ Celular Explosivo Cellulare per esplosivi 電話でドカン + Explosifs téléphone portable The %3Cellphone%4 is functionally a %3Clacker%4. Use it to connect and detonate an explosive device. Multiple devices can be linked to the cellphone and called within the phonebook.<br/><br/>%3Usage:%4<br/>%2Place an explosive.<br/>%2Use [%3%13%4], select %3Explosives%4, and select %3Cellphone%4.<br/>%2Open the cellphone interface with [%3%12%4].<br/>%2Navigate the phone book with the arrows and select your calling number.<br/>%2Call the number to detonate. @@ -324,6 +361,7 @@ Luzes de Leitura Portáteis Luci da Lettura Portabili 携帯読書灯 + Lampes de lecture portables %3Chemlight Shields%4 give you the ability to read your map, even in dark environments. However, when using %3Chemlight Shields%4, you will have a slight glow around you.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2elect %3Chemlights%4 and %3Prepare Chemlight Shield (Color)%4.<br/>%2Open %3Map%4.<br/>%2Use [%3%12%4] and select %3Flashlights%4 where you will find your chemlight shield. @@ -340,6 +378,7 @@ Detonação Remota Detonazione da remoto リモコン爆弾 + Détonation à distance Use %3Clackers%4 to connect and detonate an explosive device. Multiple devices can be linked to a clacker and detonated on different channels.<br/><br/>%3Usage:%4<br/>%2Place an explosive.<br/>%2Use [%3%13%4], select %3Explosives%4, and select the %3Clacker%4 you wish to link to.<br/>%2Open the ACE interface with [%3%12%4].<br/>%2Select %3Explosives%4 and select a %3Clacker%4.<br/>%2Select the %3Explosive%4 you wish to detonate. @@ -354,6 +393,8 @@ 내비게이션입니다 Naviga 測位 + Навигация + Naviguer The %3DAGR%4 is a simpler version of the %3MicroDAGR GPS%4. It has similar features but lacks the topographic and satellite imaging functions of the %3MicroDAGR GPS%4.<br/><br/>%3Usage:%4<br/>%2Equip a %3DAGR%4.<br/>%2Use [%3%12%4] and select %3Configure%4 or %3Toggle%4.<br/><br/>The following menus are available when configuring your %3DAGR:%4<br/>%11%2Data View: WIP<br/>%11%2GoTo WP: Select a waypoint to track.<br/>%11%2WP List: Add/Edit/Remove waypoints.<br/>%11%2Connect To: Connect %3DAGR%4 to the %3Vector 21 Rangefinder%4.<br/>%11%2Options @@ -368,6 +409,8 @@ '폭발'적인 복수입니다 Vendetta Esplosiva 爆発的な復讐 + Взрывная месть + Homme mort The %3Dead Man's Switch%4 is a device that allows a soldier to detonate an %3Explosive%4 when the soldier dies.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Explosives%4.<br/>%2Select %3Dead Man's Switch%4 and connect the desired %3Explosive%4.<br/>%2Repeat the process and disconnect to reverse. @@ -389,6 +432,8 @@ 폭발물을 해체합니다 Disinnesca Esplosivi 爆発物の解除 + Обезвреживание взрывчатки + Désamorcer les explosifs Protect Your Hearing @@ -396,6 +441,8 @@ 청력을 보호합니다 Proteggi il tuo Udito 聴覚の保護 + Защитите свой слух + Protéger votre audition %3Ear Plugs%4 help prevent hearing damage from repeat loud noises near a soldier. Insert %3Ear Plugs%4 to lower volume of a soldier's environment and prevent %3Combat Deafness%4.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Insert %3Ear Plugs%4. @@ -410,6 +457,8 @@ 엄폐하십시오 Mettiti in Copertura 遮蔽を造り出す + Добраться до укрытия + Se mettre à couvert The %3Entrenching Tool%4 allows soldiers to dig trenches to help defend their position. The soldier must be on soil in order to dig a trench.<br/><br/>%3Usage:%4<br/>%2Equip an %3Entrenching Tool%4.<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Select the type of trench you wish to build. @@ -424,6 +473,8 @@ Torce 손전등 フラッシュライト + Фонари + Lampes de poche Illuminate Your Map @@ -431,6 +482,8 @@ Illumina la tua Mappa 지도를 밝혀줍니다 地図に光あれ + Осветите свою карту + Éclairer votre carte %3Flashlights%4 give you the ability to read your map, even in dark environments. However, when using %3Flashlights%4, you will have a slight glow around you.<br/><br/>%3Usage:%4<br/>%2On the map screen, use [%3%12%4] and select %3Flashlights%4.<br/>%2Select the %3Flashlight%4 you want to use and select %3On%4.<br/><br/>%3Available Flashlight Items%4:<br/>%2 Fulton MX-991<br/>%2 KSF-1<br/>%2 Maglite XL50<br/><br/>%3NOTE:%4<br/>Flashlight states are persistent. @@ -445,6 +498,8 @@ Osserva dal Cielo 하늘에서 관측합니다 空から戦場を見てみよう + Наблюдайте с Небес + Observer depuis le ciel The %3High-Altitude Unit Navigated Tactical Imaging Round (HuntIR)%4 is designed to be fired from a grenade launcher. After being fired in the air, the built-in parachute will be deployed and the IR CMOS camera will activate, providing a video stream until it touches the ground or is shot down.<br/><br/>%3Usage:%4<br/>%2Equip a %3HuntIR Monitor%4 and compatible ammunition.<br/>%2Fire the %3HuntIR Round%4 as high as possible over the area you want to observe.<br/>%2Open the %3HuntIR Monitor%4.<br/>%2Use [%3%12%4], select %3Equipment%4.<br/>%2Select %3Activate HuntIR Monitor%4. @@ -459,6 +514,8 @@ Traccia la tua squadra con discrezione 은신하여 팀을 찾아냅니다 自分の部隊を追う + Следите за своей командой незаметно + Suivez votre équipe en toute discrétion The %3IR Strobe%4 is a throwable that emits an IR light pulse intermittently. The %3IR Strobe%4 can also be attached to a soldier, making it useful for tracking teammates under night vision devices.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Select %3Attach%4 and select the %3IR Strobe%4. @@ -473,6 +530,8 @@ Stazione Meteo Tascabile 휴대용 기상 관측 장비입니다 携帯気象予報所 + Карманная метеостанция + Station météo de poche The %3Kestrel 4500 Pocket Weather Tracker%4 is a mini weather station useful for collecting the the following weather data:<br/>%2Heading and wind direction<br/>%2Crosswind and headwind<br/>%2Altitude and barometric pressure<br/>%2Wet bulb temperature<br/>%2Humidity and dewpoint<br/>%2Density altitude<br/>%2Wind chill and temperature<br/>%2Time and date<br/>%2Minimum, maximum, and average values<br/><br/>%3Usage:%4<br/>%2Equip a %3Kestrel%4.<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Select %3Open%4. @@ -487,6 +546,8 @@ Triangola la tua posizione 위치를 삼각측량합니다 三角測量で位置を特定 + Передавайте свое местоположение + Trianguler votre position The %3Map Tools%4 are a set of tools that allows a soldier to measure distances and angles. Useful for land, and calculating firing solutions for artillery.<br/><br/>%3Usage:%4<br/>%2Open %3Map%4.<br/>%2Use [%3%12%4] and select %3Map Tools%4.<br/>%2 The Tool can be moved by dragging with [%3Left-Click%4] while holding [%3ALT%4]. @@ -494,6 +555,7 @@ Gli %3Strumenti Cartografici%4 permettono al soldato di misurare distanze e angoli sulla mappa. Utile a terra e per calculare direzioni di tiro per artiglieria.<br/><br/>%3Utilizzo:%4<br/>%2Apri %3Mappa%4.<br/>%2Usa [%3%12%4] e seleziona %3Strumenti Cartografici%4.<br/>%2 Lo strumento può essere spostato trascinandolo con [%3Click-Sinistro%4] premendo [%3ALT%4]. %3독도용 도구%4는 병사가 거리와 각도를 측정할 수 있는 도구 세트입니다. 지상에서 유용하며 포병 사격 솔루션 계산에 유용합니다,<br/><br/>%3사용 방법:%4<br/>%2%3지도%4를 여십시오.<br/>%2[%3%12%4]를 사용하여 %3독도용 도구%4를 선택하십시오.<br/>%2도구는 [%3Alt 키%4]를 누른 상태에서 [%3마우스 왼쪽 클릭%4]으로 드래그하여 이동할 수 있습니다. %3マップ ツール%4は、兵士が距離と角度を測定できるようにするツールのセットです。陸上や大砲の射撃工程の計算を解くのに役立ちます。<br/><br/>%3使用方法:%4<br/>%2%3マップ%4を開きます。<br/>%2[%3%12%4] を使って%3マップ ツール%4を選択します。<br/>%2 [%3ALT%4] を押しながら [%3左クリック%4] でドラッグするとツールを移動できます。 + Les %3Outils cartographiques%4 sont un ensemble d'outils permettant au soldat de mesurer des distances et des angles. Utile pour la terre et le calcul des solutions de tir pour l'artillerie.<br/><br/>%3Utilisation:%4<br/>%2Ouvrir la%3Carte%4.<br/>%2Utiliser [%3%12%4] et sélectionner %3Outils cartographiques%4.<br/>%2 L'outil peut être déplacé en le faisant glisser avec [%3Clic gauche%4] tout en maintenant [%3ALT%4]. Advanced DAGR @@ -501,6 +563,8 @@ DAGR Avanzato 고급형 DAGR입니다 より高度なDAGR + Продвинутый DAGR + DAGR avancé The %3MicroDAGR GPS%4 is an advanced version of the %3DAGR%4. It provides position, navigation, and timing (PNT) data to include:<br/>%2Compass and heading<br/>%2Date and hour synced to the mission<br/>%2Elevation (relative to sea level)<br/>%2Current speed<br/>%2GPS with topographic and satellite view<br/>%2Creating, naming, and deleting waypoints<br/>%2Friendly identification (Requires ACE BLUFOR Tracker Setting)<br/>Connection to the Vector-21 Rangefinder for data import (waypoint creation and grid reference of ranged targets)<br/><br/>%3Usage:%4<br/>%2For usage instructions, please visit the dedicated %3MicroDAGR%4 wiki. @@ -515,6 +579,8 @@ Tavole di Tiro 사거리표 射表 + Таблицы диапазонов + Tables de tir Get A Firing Solution @@ -522,6 +588,8 @@ Per una soluzione di tiro 사격 솔루션을 제공합니다 撃ち方の解を得る + Получите расчёт + Obtenir une solution de tir %3Range Tables%4 allow for a soldier to estimate accurate shot placement on direct or indirect targets (depending on asset). The %3Range Table%4 will automatically fill depending on the soldiers selected weapon/vehicle.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Select the desired %3Range Table%4. @@ -536,6 +604,8 @@ Corde 로프 ロープ + Канаты + Corde Tow With Ease @@ -543,6 +613,8 @@ Rimorchia con facilità 쉽게 견인을 할 수 있습니다 楽々けん引 + Буксируйте с легкостью + Remorquer avec facilité %3Ropes%4 have multiple uses including %3Towing%4 vehicles and %3Fast Roping%4 from helicopters.<br/><br/>%3Towing:%4<br/>%2Approach a vehicle.<br/>%2Use [%3%13%4] and select %3Towing%4.<br/>%2Select rope length.<br/>%2Select attachment point on towing vehicle.<br/>%2Select attachment on towed vehicle.<br/><br/>%3Available Rope Lengths:%4<br/>%2 3.2 meters<br/>%2 6.2 meters<br/>%2 12.2 meters<br/>%2 15.2 meters<br/>%2 18.3 meters<br/>%2 27.4 meters<br/>%2 36.6 meters @@ -557,6 +629,8 @@ Espandi le tue Fortificazioni 당신의 요새를 확장합니다 要塞を拡張する + Расширить свои укрепления + Élargissez vos fortifications %3Sandbags%4 are sacks made of sturdy material, filled with sand, used for a variety of purposes such as creating barriers or providing stability in construction projects. Useful in expanding larger placed fortifications.<br/><br/>%3Usage:%4<br/>%2Equip a %3Sandbag (Empty)%4.<br/>%2Use [%3%12%4] and select %3Deploy Sandbag%4.<br/>%2Follow on-screen instructions for placement. @@ -571,6 +645,8 @@ Raffredda l'Arma 총기의 온도를 낮춥니다 銃の熱を冷ます + Понизьте температуру оружия + Refroidir l'arme %3Spare Barrels%4 allow a soldier to reduce their weapon's heat significantly. After a short delay, the weapon's barrel will be swapped and its heat reduced. A soldier may also check the temperature of any barrels within their inventory. Not all weapons support swapping barrels.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Select %3Swap Barrel%4.<br/>%2Resume operation after barrel swap is complete. @@ -585,6 +661,8 @@ Bomboletta Spray 스프레이 페인트 ペイントスプレー + Аэрозольная краска + Bombe de peinture Tag Your Territory @@ -592,6 +670,8 @@ Marca il tuo territorio 당신의 영역을 지정합니다 自分のテリトリーをマーキング + Пометьте свою территорию + Marquez votre territoire %3Spray Paint%4 is used to tag surfaces with various symbols.<br/><br/>%3Usage:%4<br/>%2Move close to a surface (wall, vehicle, ground, etc).<br/>%2Use [%3%12%4] and select %3Tag%4.<br/>%2Choose a symbol.<br/><br/>%3Available Colors:%4<br/>%2Black<br/>%2Blue<br/>%2Green<br/>%2Red @@ -606,6 +686,8 @@ Stabilizzati Ovunque 어느 곳에나 지지대를 배치할 수 있습니다 どこでも支持器 + Опора может быть установлена в любом месте + Stabilisé partout The %3SSWT Kit%4 is a deployable tripod that allows a soldier to brace their aim when deployed. Use it when you need an elevated shooting position and there are no other objects around.<br/><br/>%3Usage:%4<br/>%2Use [%3%12%4] and select %3Equipment%4.<br/>%2Select %3SSWT Kit%4 and follow the on screen prompts to place. @@ -620,6 +702,9 @@ Tieni gli occhi nel cielo 하늘에서 계속 내려다봅니다 空の目を維持する + Не Отрывай Глаз От Неба + Gardez les yeux au ciel + Gardez les yeux au ciel %3UAV Batteries%4 are used to recharge a UAV's energy storage. Especially useful for small UAVs.<br/><br/>%3Usage:%4<br/>%2Equip a %3UAV Battery%4<br/>%2Approach a %3UAV%4 with its %3Engine Off%4.<br/>%2Use [%3%13%4] and select %3Recharge%4. @@ -634,6 +719,8 @@ Fai un'entrata 진입로를 만듭니다 堂々入場する + Создание собственного входа + Faire son entrée %3Wirecutters%4 are a tool that allows a soldier to bypass wired fencing. Useful for creating backdoor entrances into secure areas.<br/><br/>%3Usage:%4<br/>%2Move close to a fence.<br/>%2Use [%3%12%4] and select %3Cut Fence%4. @@ -664,6 +751,16 @@ ACE3 ACE3 ACE 3 + ACE3 + ACE3 + ACE3 + ACE3 + ACE3 + ACE3 + ACE3 + ACE3 + ACE3 + ACE3 Build Fortifications @@ -671,9 +768,11 @@ Costruisci Fortificazioni 요새를 건설합니다 要塞を構築する + Стройте укрепления + Construire des fortifications - The %3Fortify Tool%4 allows soldiers to build fortifications provided by their mission creator.<br/><br/>%3Usage:%4<br/>%2Pick up a %3FortifyTool%4.<br/>%2Use [%3%12%4] and select %3Fortify%4.<br/>%2Select an available fortification and follow the on screen prompts for placement. + The %3Fortify Tool%4 allows soldiers to build fortifications provided by their mission creator.<br/><br/>%3Usage:%4<br/>%2Pick up a %3Fortify Tool%4.<br/>%2Use [%3%12%4] and select %3Fortify%4.<br/>%2Select an available fortification and follow the on screen prompts for placement. %3Narzędzie do fortyfikowania%4 pozwala żołnierzom budować fortyfikacje wybrane przez twórcę misji.<br/><br/>%3Użycie:%4<br/>%2Podnieś %3Narzędzie do fortyfikowania%4.<br/>%2Użyj [%3%12%4] i wybierz %3Fortyfikuj%4.<br/>%2Wybierz dostępną fortyfikację i postępuj zgodnie ze wskazówkami na ekranie. L'%3Attrezzo di Fortificazione%4 permette ai soldati di costruire fortificazioni permesse dal creatore della missione.<br/><br/>%3Utilizzo:%4<br/>%2Raccogli un %3Attrezzo di Fortificazione%4.<br/>%2Usa [%3%12%4] e seleziona %3Fortifica%4.<br/>%2Seleziona una fortificazione disponibile e segui le indicazioni di piazzamento sullo schermo. %3요새화 도구%4를 사용하면 병사들이 임무 생성자가 제공한 요새를 구축할 수 있습니다.<br/><br/>%3사용 방법:%4<br/>%2%3요새화 도구%4를 가지십시오.<br/>%2[%3%12%4]를 사용하고 %3요새화%4를 선택하십시오.<br/>%2사용 가능한 요새를 선택하고 화면의 지시에 따라 배치하십시오. @@ -685,6 +784,8 @@ Effrazione 침입용 도구입니다 破壊して乗り込む + Взлом и проникновение + Entrée par effraction %3Lockpicks%4 are used to gain access to locked vehicles.<br/><br/>%3Usage:%4<br/>%2Equip a %3Lockpick%4.<br/>%2Approach a %3Locked%4 vehicle.<br/>Use [%3%13%4] and select %3Lockpick Vehicle%4.<br/><br/><t underline='1'>%3Note:%4</t> Lockpicks and keys are only available via scripting or ACE Vehicle Key modules. @@ -699,6 +800,8 @@ Chiavi dei Veicoli 차량 열쇠 車両キー + Взлом и проникновение + Clés de véhicule Lock/Unlock Vehicles @@ -706,6 +809,8 @@ Blocco/Sblocco di Veicoli 차량을 잠그거나 해제합니다 車両のロック/ロック解除 + Взлом и проникновение + Verrouiller/déverrouiller un véhicule %3Vehicle Keys%4 are used to lock/unlock your vehicles. Vehicle keys can exist for the whole side, or keys can be created for a particular vehicle itself.<br/><br/>%3Usage:%4<br/>%2Equip a %3Vehicle Key%4.<br/>%2Approach the vehicle that the key belongs to.<br/>Use [%3%13%4] and select %3Lock/Unlock Vehicle%4.<br/><br/><t underline='1'>%3Note:%4</t> Lockpicks and keys are only available via scripting or ACE Vehicle Key modules. diff --git a/addons/finger/XEH_postInit.sqf b/addons/finger/XEH_postInit.sqf index caa2ab54e8..6a44a5ae79 100644 --- a/addons/finger/XEH_postInit.sqf +++ b/addons/finger/XEH_postInit.sqf @@ -4,14 +4,14 @@ if (!hasInterface) exitWith {}; ["CBA_settingsInitialized", { //If not enabled, dont't bother adding eventhandler - TRACE_1("CBA_settingsInitialized eh", GVAR(enabled)); + TRACE_1("CBA_settingsInitialized eh",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; GVAR(lastFPTime) = -1; GVAR(fingersHash) = createHashMap; GVAR(pfeh_id) = -1; - [QGVAR(fingered), {_this call FUNC(incomingFinger)}] call CBA_fnc_addEventHandler; + [QGVAR(fingered), LINKFUNC(incomingFinger)] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; //Add Keybind: diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index fb65d8eac9..4509a270db 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -25,12 +25,12 @@ private _fingerPos = if (_sourceUnit == ACE_player) then { _fingerPosPrecise vectorAdd ([random (2 * FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2 * FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2 * FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y] vectorMultiply _distance) }; -TRACE_3("incoming finger:", _sourceUnit, _fingerPosPrecise, _fingerPos); +TRACE_3("incoming finger:",_sourceUnit,_fingerPosPrecise,_fingerPos); private _data = [diag_tickTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName)), _sourceUnit]; GVAR(fingersHash) set [hashValue _sourceUnit, _data]; if (GVAR(pfeh_id) == -1) then { GVAR(pfeh_id) = [DFUNC(perFrameEH), 0, []] call CBA_fnc_addPerFrameHandler; - TRACE_1("Started PFEH", GVAR(pfeh_id)); + TRACE_1("Started PFEH",GVAR(pfeh_id)); }; diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index 59405b57a5..2445986d15 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -42,7 +42,7 @@ private _sendFingerToPlayers = []; private _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]); { _nearbyMen append (crew _x); -} count (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]); +} forEach (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]); { if ((((eyePos _x) vectorDistance _playerEyePosASL) < GVAR(maxRange)) && {alive _x} && @@ -53,8 +53,7 @@ private _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)] _sendFingerToPlayers pushBack _x; }; - true -} count _nearbyMen; +} forEach _nearbyMen; TRACE_1("sending finger to",_sendFingerToPlayers); diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index e499ff8808..4af4f6b643 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -44,7 +44,7 @@ private _iconBaseSize = GVAR(sizeCoef) * BASE_SIZE * 0.10713 * (call EFUNC(commo } forEach GVAR(fingersHash); if (GVAR(fingersHash) isEqualTo createHashMap) then { - TRACE_1("Ending PFEH", GVAR(pfeh_id)); + TRACE_1("Ending PFEH",GVAR(pfeh_id)); [GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler; GVAR(pfeh_id) = -1; }; diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index 9f61aa0f7c..bdb0c835b6 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -79,7 +79,7 @@ Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros] Maximální vzdálenost mezi hráči pro ukázání směru [výchozí: 4 metry] Distanza massima tra giocatori per mostrare l'indicatore di puntamento [Predefinito: 4 metri] - 指差しのマーカー表示が他のプレイヤーに表示される最大範囲を決定できます。 [デフォルト: 4メートル] + 指差しのマーカー表示が他のプレイヤーに表示される最大範囲 [デフォルト: 4メートル] 플레이어 사이에서 가리키기 표시를 보이게 하는 최대거리를 설정합니다[기본설정: 4 미터] 设定指向标记最大显示距离。[预设:4米] 設定指向指示器最大顯示距離。[預設: 4公尺] diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 125cb59140..571c0033d9 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -1,16 +1,16 @@ #include "script_component.hpp" -[QGVAR(burn), FUNC(burn)] call CBA_fnc_addEventHandler; +[QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler; [QGVAR(playScream), { params ["_scream", "_source"]; - // only play sound if enabled in settings - if (GVAR(enableScreams)) then { + // only play sound if enabled in settings and enabled for the unit + if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { _source say3D _scream; }; }] call CBA_fnc_addEventHandler; ["ace_settingsInitialized", { - TRACE_1("settingsInit", GVAR(enabled)); + TRACE_1("settingsInit",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; if (isServer) then { @@ -31,8 +31,7 @@ [GVAR(fireSources), _key] call CBA_fnc_hashRem; }] call CBA_fnc_addEventHandler; - [{ _this call FUNC(fireManagerPFH) }, FIRE_MANAGER_PFH_DELAY, []] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(fireManagerPFH), FIRE_MANAGER_PFH_DELAY, []] call CBA_fnc_addPerFrameHandler; GVAR(fireSources) = [[], nil] call CBA_fnc_hashCreate; }; }] call CBA_fnc_addEventHandler; - diff --git a/addons/fire/functions/fnc_burn.sqf b/addons/fire/functions/fnc_burn.sqf index 08d52bd05c..1d829dfc45 100644 --- a/addons/fire/functions/fnc_burn.sqf +++ b/addons/fire/functions/fnc_burn.sqf @@ -189,7 +189,7 @@ if (_isBurning) exitWith {}; if ((_unit isEqualTo vehicle _unit) && (_sdr || ({ 0.05 > random 1 }))) then { _unit setVariable [QGVAR(stopDropRoll), true]; if !(_sdr) then { - TRACE_1("stop, drop, roll!", _unit); + TRACE_1("stop,drop,roll!",_unit); _unit setUnitPos "DOWN"; doStop _unit; }; @@ -203,7 +203,7 @@ if (_isBurning) exitWith {}; private _vehicle = vehicle _unit; if (_vehicle != _unit) then { - TRACE_1("Ejecting", _unit); + TRACE_1("Ejecting",_unit); _unit leaveVehicle _vehicle; unassignVehicle _unit; _unit action ["eject",_vehicle]; @@ -244,7 +244,7 @@ if (_isBurning) exitWith {}; private _burnIndicatorPFH = _unit getVariable [QGVAR(burnUIPFH), -1]; if (_unit isEqualTo ace_player && { _isThisUnitAlive } && { _burnIndicatorPFH < 0 }) then { - _burnIndicatorPFH = [FUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; + _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; }; }; @@ -296,7 +296,7 @@ if (_isBurning) exitWith {}; if (local _unit) then { if (_unit isEqualTo ace_player) then { - private _burnIndicatorPFH = [FUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; + private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; }; diff --git a/addons/fortify/functions/fnc_createObjectMarker.sqf b/addons/fortify/functions/fnc_createObjectMarker.sqf index 185ae640eb..ce6fd279b0 100644 --- a/addons/fortify/functions/fnc_createObjectMarker.sqf +++ b/addons/fortify/functions/fnc_createObjectMarker.sqf @@ -29,7 +29,7 @@ private _direction = getDir _object; // Marker name unique to this object private _markerNameStr = format [QGVAR(marker_%1), hashValue _object]; -private _channel = if (GVAR(markObjectsOnMap) == 2) then { 0 } else { 1 }; +private _channel = parseNumber (GVAR(markObjectsOnMap) != 2); private _marker = createMarkerLocal [_markerNameStr, _object, _channel, _unit]; TRACE_2("created",_marker,_channel); diff --git a/addons/fortify/functions/fnc_deployConfirm.sqf b/addons/fortify/functions/fnc_deployConfirm.sqf index 37e0d4fb9d..b0105a7919 100644 --- a/addons/fortify/functions/fnc_deployConfirm.sqf +++ b/addons/fortify/functions/fnc_deployConfirm.sqf @@ -38,7 +38,7 @@ private _perframeCheck = { _args params ["_unit", "_side", "_typeOf", "_posASL", "_vectorDir", "_vectorUp", "_cost"]; // Animation loop (required for longer constructions) - if (animationState _unit isNotEqualTo "AinvPknlMstpSnonWnonDnon_medic4") then { + if (_totalTime != 0 && {animationState _unit != "AinvPknlMstpSnonWnonDnon_medic4"}) then { // Perform animation [_unit, "AinvPknlMstpSnonWnonDnon_medic4"] call EFUNC(common,doAnimation); }; @@ -55,4 +55,3 @@ private _perframeCheck = { LLSTRING(progressBarTitle), _perframeCheck ] call EFUNC(common,progressBar); - diff --git a/addons/fortify/functions/fnc_deployObject.sqf b/addons/fortify/functions/fnc_deployObject.sqf index 4895b261bc..f7e9e6dbad 100644 --- a/addons/fortify/functions/fnc_deployObject.sqf +++ b/addons/fortify/functions/fnc_deployObject.sqf @@ -70,6 +70,7 @@ private _mouseClickID = [_player, "DefaultAction", {GVAR(isPlacing) == PLACE_WAI [_unit, _object] call FUNC(deployConfirm); } else { TRACE_1("deleting object",_object); + [QGVAR(onDeployStop), [_unit, _object, _cost]] call CBA_fnc_localEvent; deleteVehicle _object; }; }; diff --git a/addons/fortify/functions/fnc_handleChatCommand.sqf b/addons/fortify/functions/fnc_handleChatCommand.sqf index 46bdc3cb0b..1422558de8 100644 --- a/addons/fortify/functions/fnc_handleChatCommand.sqf +++ b/addons/fortify/functions/fnc_handleChatCommand.sqf @@ -20,7 +20,7 @@ TRACE_1("handleChatCommand",_args); _args = _args splitString " "; if (_args isEqualTo []) exitWith {ERROR("Bad command");}; -private _command = toLower (_args select 0); +private _command = toLowerANSI (_args select 0); _args deleteAt 0; switch (_command) do { diff --git a/addons/fortify/functions/fnc_parseSide.sqf b/addons/fortify/functions/fnc_parseSide.sqf index 3e9ca5d78d..6af2fac4b4 100644 --- a/addons/fortify/functions/fnc_parseSide.sqf +++ b/addons/fortify/functions/fnc_parseSide.sqf @@ -22,7 +22,7 @@ TRACE_1("parseSide",_side); if (_side isEqualType sideUnknown) exitWith {_side}; -private _char = toLower (_side select [0, 1]); +private _char = toLowerANSI (_side select [0, 1]); private _return = switch (_char) do { case ("b"); diff --git a/addons/fortify/functions/fnc_registerObjects.sqf b/addons/fortify/functions/fnc_registerObjects.sqf index b8e7abd171..7fea4996a4 100644 --- a/addons/fortify/functions/fnc_registerObjects.sqf +++ b/addons/fortify/functions/fnc_registerObjects.sqf @@ -28,7 +28,7 @@ TRACE_3("registerObjects",_side,_budget,_objects); if (_side isEqualTo sideUnknown) exitWith {ERROR_1("Bad Side %1",_this);}; -_objects select { +_objects = _objects select { private _isValid = _x params [["_xClassname", "", [""]], ["_xCost", 0, [0]]]; private _category = toLower (_x param [2, "", [""]]); if (_category != "") then { _x set [2, _category]; }; diff --git a/addons/fortify/stringtable.xml b/addons/fortify/stringtable.xml index c3fda20caf..15150d6685 100644 --- a/addons/fortify/stringtable.xml +++ b/addons/fortify/stringtable.xml @@ -145,7 +145,7 @@ Mostra aggiornamenti di budget 顯示預算更新 显示预算更新 - 予算の更新を表示 + 予算更新を表示 Pokaż aktualizacje budżetu Показывать обновления бюджета Bütçe güncellenmelerini göster @@ -160,7 +160,7 @@ 決定預算變更時是否會顯示提示 决定预算变更时是否会显示提示 Controlla se vengono mostrati avvisi di aggiornamento del budget - 予算が更新されヒント表示時の操作を決定します + 予算更新のヒントが表示される場面を制御します Kontroluje kiedy aktualizacje budżetu są wyświetlane Настраивает сообщения об обновлении бюджета Bütçe güncellenince bilgi verilip verilmeyeceğini kontrol eder. @@ -190,7 +190,7 @@ Ha l'attrezzo di fortificazione 有要塞工具 有设防工具 - 要塞ツール所持の時 + 要塞ツール所持時 Posiada narzędzie do fortyfikowania Если имеется инструмент Insa Etme Aleti Olanlara Göster @@ -233,7 +233,7 @@ 건축물을 지을 때 걸리는 시간을 계수를 적용하여 계산합니다. Koeffizient zur Bestimmung der Bauzeit \nA in Ax + b, wobei x die Kosten des Objekts sind. Il coefficiente 'C' che determina il tempo di costruzione.\nTempo Totale = Costo * C + Tempo Minimo - 建造する時間を決定するために使用される係数。\n計算式はAx + bです。この係数はAであり、xは建造物のコストです。 + 建造する時間を定義するために使用される係数。\n計算式はAx + bです。この係数はAであり、xは建造物のコストです。 Współczynnik używany do określenia czasu budowy konstrukcji.\nA w Ax + b gdzie x jest kosztem obiektu Коэффициент используемый для указания времени необходимого для возведения постройки.\nA в формуле Ax + b, где x - это цена объекта Coeficiente usado para determinar el tiempo de construcción de una estructura.\nA en Ax + b donde x es el coste del objeto diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index ecebd793ce..096b4dde97 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -2,7 +2,7 @@ if (isServer) then { GVAR(lastFragTime) = -1; - [QGVAR(frag_eh), {_this call FUNC(frago);}] call CBA_fnc_addEventHandler; + [QGVAR(frag_eh), LINKFUNC(frago)] call CBA_fnc_addEventHandler; }; ["CBA_settingsInitialized", { diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf index 7c2b5d1681..358a9ee71e 100644 --- a/addons/frag/functions/fnc_addPfhRound.sqf +++ b/addons/frag/functions/fnc_addPfhRound.sqf @@ -67,7 +67,7 @@ if (alive _round) then { getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force)), getNumber (configFile >> "CfgAmmo" >> _type >> "indirecthit") * (sqrt (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))) ]; - TRACE_1("Initializing track", _round); + TRACE_1("Initializing track",_round); GVAR(objects) pushBack _round; GVAR(arguments) pushBack _args; diff --git a/addons/frag/functions/fnc_dev_debugAmmo.sqf b/addons/frag/functions/fnc_dev_debugAmmo.sqf index ec52b4b39f..4484edbdc4 100644 --- a/addons/frag/functions/fnc_dev_debugAmmo.sqf +++ b/addons/frag/functions/fnc_dev_debugAmmo.sqf @@ -28,7 +28,7 @@ private _allMagsConfigs = configProperties [configFile >> "CfgMagazines", "isCla private _processedCfgAmmos = []; { - private _ammo = toLower getText (_x >> "ammo"); + private _ammo = toLowerANSI getText (_x >> "ammo"); if (_ammo != "" && {!(_ammo in _processedCfgAmmos)}) then { _processedCfgAmmos pushBack _ammo; diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf index 023a283e81..70c7471181 100644 --- a/addons/frag/functions/fnc_doReflections.sqf +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -22,5 +22,5 @@ if (_depth <= 2) then { private _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); private _indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit"); private _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; - [DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 355da901c6..7ea4212d9a 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -17,7 +17,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); private _shouldAdd = GVAR(cacheRoundsTypesToTrack) getVariable _ammo; if (isNil "_shouldAdd") then { diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index f2700654c3..87fabc4fc5 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -144,7 +144,7 @@ if (_objects isNotEqualTo []) then { private _vel = _vec vectorMultiply _fp; private _fragObj = (selectRandom _fragTypes) createVehicleLocal [0,0,10000]; - // TRACE_4("targeted",_fp, typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); + // TRACE_4("targeted",_fp,typeOf _fragObj,_lastPos vectorDistance _targetPos,typeOf _x); _fragObj setPosASL _lastPos; _fragObj setVectorDir _vec; _fragObj setVelocity _vel; diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf index 6e75e80951..ef0fbc3eda 100644 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -45,7 +45,7 @@ while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}} // Clean up dead object references private _deletionCount = 0; { - TRACE_1("GC Projectile", _x); + TRACE_1("GC Projectile",_x); private _deleteIndex = _x - _deletionCount; GVAR(objects) deleteAt _deleteIndex; GVAR(arguments) deleteAt _deleteIndex; diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf index bd5a229f0e..ce734a08e3 100644 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -26,7 +26,7 @@ if (!alive _round) exitWith { if (_skip == 0) then { if ((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1}) then { // shotbullet, shotShell don't seem to explode when touching water, so don't create frags - if ((surfaceIsWater _lastPos) && {(toLower getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {}; + if ((surfaceIsWater _lastPos) && {(toLowerANSI getText (configFile >> "CfgAmmo" >> _shellType >> "simulation")) in ["shotbullet", "shotshell"]}) exitWith {}; private _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); private _isArmed = _firedPos vectorDistance _lastPos >= _fuseDist; // rounds explode at exactly fuseDistance, so check inclusive TRACE_2("",_fuseDist,_isArmed); diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 7addcd4c38..f88877448d 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -105,7 +105,7 @@ Active la simulation de la réflexion des explosions ACE. Ativa a simulação de reflexo de explosão do ACE Включить симуляцию отражения взрывов ACE - ACE爆発反射シミュレーションを有効化 + ACE 爆発反射シミュレーションを有効化 ACE 폭발 반사 시뮬레이션을 적용합니다. 启用 ACE 模拟爆炸反射 啟用ACE模擬爆炸反射 @@ -136,9 +136,9 @@ 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) Ce paramètre contrôle le nombre maximum de projectiles et d'éclats résultant de la fragmentation, que le système peut suivre à chaque instant.\nSi plus de projectiles sont générés, ils ne seront pas pris en compte. Baissez ce réglage si vous ne voulez pas de chute de FPS en cas de nombre important de projectiles (>200 éclats en même temps). Ez a beállítás szabályozza a repeszeződés és pattogzás által kilőtt objektumok követett számát. Ha több ez a szám, ezek az objektumok nem lesznek követve. Csökkentsd ezt a beállítást, ha nem akarsz lassulásokat magas-törmelékmennyiségű helyzetekben (200+ repesz a levegőben egyszerre) - Эта настройка контролирует максимальное количество снарядов, которок отслеживает система осколков и обломков в каждый момент времени. Снаряды, выстреленные сверх этого числа, отслеживаться не будут. Уменьшите это значение, если вы не хотите падения FPS при большом количестве снарядов в одной перестрелке (> 200 одновременно летящих снарядов) + Эта настройка контролирует максимальное количество снарядов, которок отслеживает система осколков и обломков в каждый момент времени. /nСнаряды, выстреленные сверх этого числа, отслеживаться не будут. Уменьшите это значение, если вы не хотите падения FPS при большом количестве снарядов в одной перестрелке (> 200 одновременно летящих снарядов) Questo parametro controlla il numero massimo di proiettili che la frammentazione e il sistema di spalling tracciano in ogni momento. Se vengono sparati ulteriori proiettili, non verranno tracciati. Abbassa questo parametro se non vuoi cali di FPS in scenari con molti proiettili (>200 proiettili in aria contemporaneamente) - この設定では、断片化および剥離システムが常に追跡する飛翔体の最大量を制御します。 さらに多くの飛翔体が発射された場合、それらは追跡されません。 弾数が多いシナリオでFPSを低下させたくない場合は、この設定を下げてください。 (一度に200発以上が空中に発射されます) + この設定では、断片化および剥離システムが常に追跡する飛翔体の最大量を制御します。 この値より多くの飛翔体が発射された場合、それらは追跡されません。 弾数が多いシナリオでFPSを低下させたくない場合は、この設定を下げてください。 (一度に200発以上が空中に発射されます) 이 설정은 탄환파편 및 파편 시스템으로 인해 생긴 발사체의 수를 결정합니다. 만약 더 많은 발사체가 나올 경우 정해진 수 이외에는 추적하지 않습니다. 이 설정을 낮춤으로써 파편이 많은 시나리오를 실행할때 더욱 원활히 진행할 수 있습니다 (한 번에 200개 이하) 设定在指定时间内,系统最大可追踪的破片粒子数量。如有更多的碎片在这之后产生,这些粒子将不会被追踪。如果你想要维持好的帧数,此设定勿调的过高。( >一次200颗粒子) 設定在指定時間內,系統最大可追蹤的碎片/剝落粒子數量。如有更多的碎片在這之後產生,這些粒子將不會被追蹤。如果你想要維持好的幀數,此設定勿調的過高。( >一次200顆粒子) @@ -170,7 +170,7 @@ A lepattogzási útvonalak számításának darabjai képkockánként. Ez eloszlatja az FPS-megszakadást több képkockára, ezzel csökkentve a súlyosságát. Число обрабатываемых осколков за кадр. Это позволяет распределить нагрузку по отслеживанию осколков между несколькими кадрами, чтобы предотвратить падение FPS. Il numero di calcoli per tracciamento di spalling ad ogni frame. Questo aiuta a distribuire l'impatto del tracciamento dello spalling su più frame, riducendolo ulteriormente. - 与えられたフレームごとに追跡する剥離飛翔体の数を決定します。FPS に影響をあたえないよう、剥離飛翔体を複数のフレームで追跡し、分散させています。 + 任意のフレームごとに追跡される剥離飛翔体の数。剥離による飛翔体を追跡することによるFPSへの影響を複数フレームに分散させ抑えることが出来ます。 가능한 프레임마다 파편을 추적 및 계산합니다. 여러 프레임에 걸쳐 파편난 발사체를 추적하여 FPS에 도움을 줍니다. 이를 제한함으로써 더욱 큰 효과를 볼 수 있습니다. 设定在每一帧数内,系统最大可追踪的破片粒子数量。此设定可有效帮助系统减低计算压力。 設定在每一幀數內,系統最大可追蹤的碎片/剝落粒子數量。此設定可有效幫助系統減低計算壓力 diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf index 935b81aa61..5133f48c41 100644 --- a/addons/gestures/XEH_postInit.sqf +++ b/addons/gestures/XEH_postInit.sqf @@ -31,9 +31,7 @@ if (!hasInterface) exitWith {}; [_key, [false, (_key != -1), false]], false ] call CBA_fnc_addKeybind; - - false -} count [ +} forEach [ ["Freeze", 80], // Numpad 2 ["Cover", 81], // Numpad 3 ["Forward", 75], // Numpad 4 diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf index a2f69dd608..d0d58488d3 100644 --- a/addons/gforces/XEH_postInit.sqf +++ b/addons/gforces/XEH_postInit.sqf @@ -12,8 +12,7 @@ GVAR(playerIsVirtual) = false; ["unit", { // Add unit changed EH to check if player is either virtual (logic) or a UAV AI params ["_unit"]; - GVAR(playerIsVirtual) = ((getNumber (configOf _unit >> "isPlayableLogic")) == 1) || - {(getText (configOf _unit >> "simulation")) == "UAVPilot"}; + GVAR(playerIsVirtual) = unitIsUAV _unit || {(getNumber (configOf _unit >> "isPlayableLogic")) == 1}; TRACE_3("unit changed",_unit,typeOf _unit,GVAR(playerIsVirtual)); }, true] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 7700d4cc81..e5a6bf5d1c 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -88,10 +88,10 @@ if (!hasInterface) exitWith {}; if (GVAR(effects) in [2, 3]) then { // Register fire event handler - ["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; //Add Explosion XEH - ["CAManBase", "explosion", FUNC(handleExplosion)] call CBA_fnc_addClassEventHandler; + ["CAManBase", "explosion", LINKFUNC(handleExplosion)] call CBA_fnc_addClassEventHandler; GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992]; GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [1, 1, 1, 0]]; diff --git a/addons/goggles/functions/fnc_applyRainEffect.sqf b/addons/goggles/functions/fnc_applyRainEffect.sqf index 3332db536a..0058209acd 100644 --- a/addons/goggles/functions/fnc_applyRainEffect.sqf +++ b/addons/goggles/functions/fnc_applyRainEffect.sqf @@ -22,7 +22,7 @@ if (!alive _unit) exitWith {}; private _fnc_underCover = { params ["_unit"]; - if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; + if (!isNull objectParent _unit && {!isTurnedOut _unit}) exitWith {true}; // looking up and no roof over head private _position = eyePos _unit; diff --git a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf index 3513eb191a..85b7e60934 100644 --- a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf +++ b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf @@ -23,7 +23,7 @@ if (!alive _unit) exitWith {}; GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; if (GVAR(FrameEvent) select 0) exitWith { - if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith { + if (!isNull objectParent _unit && {!isTurnedOut _unit}) exitWith { (GVAR(FrameEvent) select 1) set [0, false]; }; diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf index ea3455dcee..0c711169ef 100644 --- a/addons/goggles/functions/fnc_handleFired.sqf +++ b/addons/goggles/functions/fnc_handleFired.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); // no dust in rain if (rain > 0.1) exitWith {true}; diff --git a/addons/goggles/functions/fnc_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf index 8c3b29723d..6784e9db12 100644 --- a/addons/goggles/functions/fnc_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -36,7 +36,6 @@ private _rotorWash = [false, 0]; _rotorWash set [1, _distance]; }; }; - false -} count (position _unit nearEntities [["Helicopter"], _radius]); +} forEach (position _unit nearEntities [["Helicopter"], _radius]); _rotorWash diff --git a/addons/goggles/stringtable.xml b/addons/goggles/stringtable.xml index 5fc06612d0..f02b95bf5c 100644 --- a/addons/goggles/stringtable.xml +++ b/addons/goggles/stringtable.xml @@ -101,7 +101,7 @@ Effects - эффекты + Эффекты エフェクト Efekty Effekte diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 7f67e181cc..c23640bca5 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -2,12 +2,12 @@ #include "script_component.hpp" -["ace_flashbangExploded", {_this call FUNC(flashbangExplosionEH)}] call CBA_fnc_addEventHandler; +["ace_flashbangExploded", LINKFUNC(flashbangExplosionEH)] call CBA_fnc_addEventHandler; // Register fired event handlers -["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; -["ace_firedPlayerNonLocal", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; -["ace_firedNonPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedPlayerNonLocal", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedNonPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index bba3cffd4d..d54f600179 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -63,6 +63,7 @@ _affected = _affected - [ACE_player]; if (_flashReactionDebounce < CBA_missionTime) then { // Not used interally but could be useful for other mods _unit setVariable [QGVAR(flashStrength), _strength, true]; + [QGVAR(flashbangedAI), [_unit, _strength, _grenadePosASL]] call CBA_fnc_localEvent; { _unit setSkill [_x, (_unit skill _x) / 50]; } forEach SUBSKILLS; @@ -84,7 +85,7 @@ _affected = _affected - [ACE_player]; }, [_unit]] call CBA_fnc_waitUntilAndExecute; }; }; -} count _affected; +} forEach _affected; // Affect local player, independently of distance if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { @@ -117,7 +118,7 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { }; // add ace_medical pain effect: - if (["ace_medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1}) then { + if (["ace_medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then { [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); }; @@ -144,11 +145,11 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { //PARTIALRECOVERY - start decreasing effect over time [{ - params ["_strength"]; + params ["_strength", "_blend"]; - GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1, 1, 0, _blend, [0,0,0,1], [0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); - }, [_strength], 7 * _strength] call CBA_fnc_waitAndExecute; + }, [_strength, _blend], 7 * _strength] call CBA_fnc_waitAndExecute; //FULLRECOVERY - end effect [{ @@ -162,5 +163,7 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { private _maxFlinch = linearConversion [0.2, 1, _strength, 0, 95, true]; private _flinch = (_minFlinch + random (_maxFlinch - _minFlinch)) * selectRandom [-1, 1]; ACE_player setDir (getDir ACE_player + _flinch); + + [QGVAR(flashbangedPlayer), [_strength, _grenadePosASL]] call CBA_fnc_localEvent; }; true diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 4105e861f6..9a0168da3e 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (_weapon != "Throw") exitWith {}; diff --git a/addons/gunbag/XEH_preInit.sqf b/addons/gunbag/XEH_preInit.sqf index 2bb35513a2..3149314f87 100644 --- a/addons/gunbag/XEH_preInit.sqf +++ b/addons/gunbag/XEH_preInit.sqf @@ -26,17 +26,41 @@ PREP_RECOMPILE_END; }, _this] call CBA_fnc_execNextFrame; }] call CBA_fnc_addClassEventHandler; +[QEGVAR(arsenal,loadoutVerified), { + params ["_loadout", "_extendedInfo", "", "", "_missingExtendedInfo"]; + private _gunbagInfo = _extendedInfo getOrDefault [QGVAR(gunbagWeapon), []]; + if (_gunbagInfo isEqualTo []) exitWith {}; + + private _weapon = (_gunbagInfo select 0) call EFUNC(arsenal,baseWeapon); + if !(_weapon in EGVAR(arsenal,virtualItemsFlat)) exitWith { + _missingExtendedInfo pushBack [QGVAR(gunbagWeapon), _weapon]; + _extendedInfo deleteAt QGVAR(gunbagWeapon); + }; + private _missingItems = []; + private _attachments = _gunbagInfo select 1; + { + if (_x != "" && {!(_x call EFUNC(arsenal,baseWeapon) in EGVAR(arsenal,virtualItemsFlat))}) then { + _missingItems pushBack _x; + _attachments set [_forEachIndex, ""]; + }; + } forEach _attachments; + private _magazines = _gunbagInfo select 2; + { + private _class = _x param [0, ""]; + if (_class != "" && {!(_class in EGVAR(arsenal,virtualItemsFlat))}) then { + _missingItems pushBack _class; + _magazines set [_forEachIndex, ["", 0]]; + }; + } forEach _magazines; + if (_missingItems isNotEqualTo []) then { + _missingExtendedInfo pushBack [QGVAR(gunbagWeapon), _missingItems]; + }; +}] call CBA_fnc_addEventHandler; + ["CBA_loadoutSet", { params ["_unit", "_loadout", "_extendedInfo"]; private _gunbagWeapon = _extendedInfo getOrDefault [QGVAR(gunbagWeapon), []]; if (_gunbagWeapon isNotEqualTo []) then { - if (!isNil QEGVAR(arsenal,virtualItemsFlatAll)) then { - private _weapon = (_gunbagWeapon select 0) call EFUNC(arsenal,baseWeapon); - if !(_weapon in EGVAR(arsenal,virtualItemsFlatAll)) then { - INFO_1("removing [%1] from loadout",_gunbagWeapon); - _gunbagWeapon = []; - }; - }; (backpackContainer _unit) setVariable [QGVAR(gunbagWeapon), _gunbagWeapon, true]; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/gunbag/functions/fnc_isMachineGun.sqf b/addons/gunbag/functions/fnc_isMachineGun.sqf index f07866a4aa..e6e4e5c96c 100644 --- a/addons/gunbag/functions/fnc_isMachineGun.sqf +++ b/addons/gunbag/functions/fnc_isMachineGun.sqf @@ -22,7 +22,7 @@ private _config = _weapon call CBA_fnc_getItemConfig; // definition of a machine gun by BIS_fnc_itemType private _cursor = getText (_config >> "cursor"); -if (toLower _cursor in ["", "emptycursor"]) then { +if (toLowerANSI _cursor in ["", "emptycursor"]) then { _cursor = getText (_config >> "cursorAim"); }; diff --git a/addons/headless/XEH_postInit.sqf b/addons/headless/XEH_postInit.sqf index 103d5c1834..d1c76a332b 100644 --- a/addons/headless/XEH_postInit.sqf +++ b/addons/headless/XEH_postInit.sqf @@ -1,12 +1,12 @@ #include "script_component.hpp" -["ace_settingsInitialized", { +["CBA_settingsInitialized", { // Register and remove HCs if not client that is not server and distribution or end mission enabled if ((!hasInterface || isServer) && {XGVAR(enabled) || XGVAR(endMission) != 0}) then { if (isServer) then { // Request rebalance on any unit spawn (only if distribution enabled) if (XGVAR(enabled)) then { - ["AllVehicles", "initPost", FUNC(handleSpawn), nil, nil, true] call CBA_fnc_addClassEventHandler; + ["CAManBase", "initPost", LINKFUNC(handleSpawn), nil, nil, true] call CBA_fnc_addClassEventHandler; }; // Add disconnect EH addMissionEventHandler ["HandleDisconnect", {call FUNC(handleDisconnect)}]; diff --git a/addons/headless/XEH_preInit.sqf b/addons/headless/XEH_preInit.sqf index bd64702f5c..c51b62cf57 100644 --- a/addons/headless/XEH_preInit.sqf +++ b/addons/headless/XEH_preInit.sqf @@ -12,8 +12,7 @@ if (isServer) then { GVAR(headlessClients) = []; GVAR(inRebalance) = false; GVAR(endMissionCheckDelayed) = false; - GVAR(blacklistType) = [BLACKLIST_UAV]; - [QXGVAR(headlessClientJoined), FUNC(handleConnectHC)] call CBA_fnc_addEventHandler; + [QXGVAR(headlessClientJoined), LINKFUNC(handleConnectHC)] call CBA_fnc_addEventHandler; }; ADDON = true; diff --git a/addons/headless/functions/fnc_handleConnectHC.sqf b/addons/headless/functions/fnc_handleConnectHC.sqf index b19ef25012..e5acaf48fc 100644 --- a/addons/headless/functions/fnc_handleConnectHC.sqf +++ b/addons/headless/functions/fnc_handleConnectHC.sqf @@ -19,17 +19,14 @@ params ["_headlessClient"]; // Exit if HC already registered // No need to check if distribution or end mission enabled, as if disabled this will never run -if (_headlessClient in GVAR(headlessClients)) exitWith {}; - -// Register for use -GVAR(headlessClients) pushBack _headlessClient; +if (GVAR(headlessClients) pushBackUnique _headlessClient == -1) exitWith {}; if (XGVAR(log)) then { INFO_1("Registered HC: %1",_headlessClient); }; // Exit if AI distribution is disabled -if (!XGVAR(enabled)) exitWith {true}; +if (!XGVAR(enabled)) exitWith {}; // Rebalance [true] call FUNC(rebalance); diff --git a/addons/headless/functions/fnc_handleDisconnect.sqf b/addons/headless/functions/fnc_handleDisconnect.sqf index c94cec2599..a18f22a3bd 100644 --- a/addons/headless/functions/fnc_handleDisconnect.sqf +++ b/addons/headless/functions/fnc_handleDisconnect.sqf @@ -17,7 +17,7 @@ */ params ["_object"]; -TRACE_1("HandleDisconnect",_this); +TRACE_1("HandleDisconnect",_object); // Exit if not HC if !(_object in GVAR(headlessClients)) exitWith { @@ -28,9 +28,7 @@ if !(_object in GVAR(headlessClients)) exitWith { if (CBA_missionTime < 150) then { TRACE_1("Mission start delay",CBA_missionTime); GVAR(endMissionCheckDelayed) = true; - [{ - call FUNC(endMissionNoPlayers); - }, [], 150 - CBA_missionTime] call CBA_fnc_waitAndExecute; + [LINKFUNC(endMissionNoPlayers), [], 150 - CBA_missionTime] call CBA_fnc_waitAndExecute; } else { // End instantly or after delay if (XGVAR(endMission) == 1) then { @@ -39,7 +37,7 @@ if !(_object in GVAR(headlessClients)) exitWith { } else { TRACE_2("Delayed 60s end",GVAR(endMission),CBA_missionTime); GVAR(endMissionCheckDelayed) = true; - [FUNC(endMissionNoPlayers), [], 60] call CBA_fnc_waitAndExecute; + [LINKFUNC(endMissionNoPlayers), [], 60] call CBA_fnc_waitAndExecute; }; }; }; diff --git a/addons/headless/functions/fnc_handleSpawn.sqf b/addons/headless/functions/fnc_handleSpawn.sqf index 50277e3845..56b74f407d 100644 --- a/addons/headless/functions/fnc_handleSpawn.sqf +++ b/addons/headless/functions/fnc_handleSpawn.sqf @@ -4,27 +4,22 @@ * Handles AI spawn and requests a rebalance if applicable. * * Arguments: - * 0: Object + * 0: Unit * * Return Value: * None * * Example: - * [object] call ace_headless_fnc_handleSpawn + * [cursorObject] call ace_headless_fnc_handleSpawn * * Public: No */ -params ["_object"]; -TRACE_1("Spawn",_object); +params ["_unit"]; +TRACE_1("Spawn",_unit); -// Exit if HC transferring disabled or object not a unit (including unit inside vehicle) or is player -if (!(_object in allUnits) || {isPlayer _object}) exitWith {}; - -// Exit and blacklist if of blacklist type -if ({_object isKindOf _x} count GVAR(blacklistType) > 0) exitWith { - _object setVariable [QXGVAR(blacklist), true]; -}; +// Exit if unit is player or UAV crew +if (isPlayer _unit || {unitIsUAV _unit}) exitWith {}; // Rebalance [false] call FUNC(rebalance); diff --git a/addons/headless/functions/fnc_rebalance.sqf b/addons/headless/functions/fnc_rebalance.sqf index 84be441ebe..5ec32f39bd 100644 --- a/addons/headless/functions/fnc_rebalance.sqf +++ b/addons/headless/functions/fnc_rebalance.sqf @@ -23,7 +23,7 @@ TRACE_3("Rebalance",GVAR(inRebalance),GVAR(headlessClients),_force); if (GVAR(inRebalance) || {GVAR(headlessClients) isEqualTo []}) exitWith {}; // Transfer after rebalance delay -[FUNC(transferGroups), [_force], XGVAR(Delay)] call CBA_fnc_waitAndExecute; +[LINKFUNC(transferGroups), _force, XGVAR(delay)] call CBA_fnc_waitAndExecute; // Currently in rebalance flag GVAR(inRebalance) = true; diff --git a/addons/headless/functions/fnc_transferGroups.sqf b/addons/headless/functions/fnc_transferGroups.sqf index cee85a5109..60d3c093d1 100644 --- a/addons/headless/functions/fnc_transferGroups.sqf +++ b/addons/headless/functions/fnc_transferGroups.sqf @@ -79,8 +79,8 @@ private _numTransferredHC3 = 0; _transfer = false; }; - // No transfer if player in this group - if (isPlayer _x) exitWith { + // No transfer if player or UAV in this group + if (isPlayer _x || {unitIsUAV _x}) exitWith { _transfer = false; }; @@ -89,14 +89,16 @@ private _numTransferredHC3 = 0; _transfer = false; }; - // No transfer if vehicle unit is in or crew in that vehicle is blacklisted - if (vehicle _x != _x && {(vehicle _x) getVariable [QXGVAR(blacklist), false]}) exitWith { + private _vehicle = objectParent _x; + + // No transfer if the vehicle the unit is in or if the crew in that vehicle is blacklisted + if ((_vehicle getVariable [QXGVAR(blacklist), false]) || {unitIsUAV _vehicle}) exitWith { _transfer = false; }; // Save gear if unit about to be transferred with current loadout (naked unit work-around) if (XGVAR(transferLoadout) == 1) then { - _x setVariable [QGVAR(loadout), [_x] call CBA_fnc_getLoadout, true]; + _x setVariable [QGVAR(loadout), _x call CBA_fnc_getLoadout, true]; }; } forEach (units _x); }; @@ -132,7 +134,7 @@ private _numTransferredHC3 = 0; }; }; default { - TRACE_1("No Valid HC to transfer to", _currentHC); + TRACE_1("No Valid HC to transfer to",_currentHC); }; }; }; @@ -140,7 +142,7 @@ private _numTransferredHC3 = 0; if (XGVAR(log)) then { private _numTransferredTotal = _numTransferredHC1 + _numTransferredHC2 + _numTransferredHC3; - INFO_4("Groups Transferred: Total: %1 - HC1: %2 - HC2: %3 - HC3: %4", _numTransferredTotal, _numTransferredHC1, _numTransferredHC2, _numTransferredHC3); + INFO_4("Groups Transferred: Total: %1 - HC1: %2 - HC2: %3 - HC3: %4",_numTransferredTotal,_numTransferredHC1,_numTransferredHC2,_numTransferredHC3); }; // Allow rebalance flag diff --git a/addons/headless/initSettings.inc.sqf b/addons/headless/initSettings.inc.sqf index cb5fe6e53d..d00cb6eb30 100644 --- a/addons/headless/initSettings.inc.sqf +++ b/addons/headless/initSettings.inc.sqf @@ -4,7 +4,7 @@ [ELSTRING(common,Enabled), LSTRING(EnabledDesc)], format ["ACE %1", LLSTRING(Module)], false, - true, + 1, {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true ] call CBA_fnc_addSetting; @@ -15,9 +15,8 @@ [LSTRING(Delay), LSTRING(DelayDesc)], format ["ACE %1", LLSTRING(Module)], [0, 60, 15, -1], - true, - {[QGVAR(delay), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + 1, + {[QGVAR(delay), _this] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ @@ -26,7 +25,7 @@ [LSTRING(EndMission), LSTRING(EndMissionDesc)], format ["ACE %1", LLSTRING(Module)], [[0, 1, 2], [ELSTRING(Common,Disabled), LSTRING(Instant), LSTRING(Delayed)], 0], - true, + 1, {[QGVAR(delay), _this] call EFUNC(common,cbaSettings_settingChanged)}, true ] call CBA_fnc_addSetting; @@ -37,9 +36,8 @@ [LSTRING(Log), LSTRING(LogDesc)], format ["ACE %1", LLSTRING(Module)], false, - true, - {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + 1, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ @@ -48,7 +46,7 @@ [LSTRING(TransferLoadout), LSTRING(TransferLoadoutDesc)], format ["ACE %1", LLSTRING(Module)], [[0, 1, 2], [ELSTRING(Common,Disabled), LSTRING(TransferLoadoutCurrent), LSTRING(TransferLoadoutConfig)], 0], - true, + 1, {}, true // needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/headless/script_component.hpp b/addons/headless/script_component.hpp index c73e2260de..73761a7bb1 100644 --- a/addons/headless/script_component.hpp +++ b/addons/headless/script_component.hpp @@ -17,4 +17,3 @@ #include "\z\ace\addons\main\script_macros.hpp" #define DELAY_DEFAULT 15 -#define BLACKLIST_UAV "UAV", "UAV_AI_base_F", "B_UAV_AI", "O_UAV_AI", "I_UAV_AI" diff --git a/addons/headless/stringtable.xml b/addons/headless/stringtable.xml index 584c12f954..35dcb11862 100644 --- a/addons/headless/stringtable.xml +++ b/addons/headless/stringtable.xml @@ -62,7 +62,7 @@ Minimale Verzögerung zwischen Transfers in Sekunden. (Standard: 15) Minimalny odstęp pomiędzy transferami w sekundach. (Domyślnie: 15) 전송 간 최소 지연 시간, 초당. (기본값: 15) - 移行する際の最低遅延を秒数で設定します。 (デフォルト: 15) + 移行する際の最低遅延を秒単位で設定します。 (デフォルト: 15) Délai minimum entres les transferts, en secondes. (Défaut: 15) 设定每次转换间隔多少秒。(预设:15秒) 設定每次轉換間隔多少秒。(預設:15秒) diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index 310be3675b..8143e2ce0d 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -13,15 +13,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - clientinit = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); - }; -}; - -class Extended_Init_EventHandlers { - class CAManBase { - class GVAR(AddEarPlugs) { - serverInit = QUOTE(_this call FUNC(addEarPlugs)); - }; + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index d8b21f214a..e6f328ad78 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -1,7 +1,19 @@ #include "script_component.hpp" +if (isServer) then { + ["CBA_settingsInitialized", { + TRACE_1("settingInit - server",GVAR(EnableCombatDeafness)); + // Only install event handler if combat deafness is enabled + if (!GVAR(EnableCombatDeafness)) exitWith {}; + + ["CAManBase", "Init", LINKFUNC(addEarPlugs), true, [], true] call CBA_fnc_addClassEventHandler; + }] call CBA_fnc_addEventHandler; +}; + if (!hasInterface) exitWith {}; +#include "initKeybinds.inc.sqf" + GVAR(cacheAmmoLoudness) = call CBA_fnc_createNamespace; GVAR(deafnessDV) = 0; @@ -21,6 +33,8 @@ GVAR(lastPlayerVehicle) = objNull; // Spawn volume updating process [LINKFUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; + [QGVAR(updateVolume), LINKFUNC(updateVolume)] call CBA_fnc_addEventHandler; + // Update veh attunation when player veh changes ["vehicle", { params ["_player", "_vehicle"]; diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 2ab07c31e6..7a6195ec46 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -12,7 +12,8 @@ PREP_RECOMPILE_END; params ["_unit", "_loadout", "_extendedInfo"]; if (_extendedInfo getOrDefault ["ace_earplugs", false]) then { _unit setVariable ["ACE_hasEarPlugsIn", true, true]; - [[true]] remoteExec [QFUNC(updateVolume), _unit]; + + [QGVAR(updateVolume), [[true]], _unit] call CBA_fnc_targetEvent; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index b73c94bf01..fdbcfbc621 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -15,19 +15,22 @@ * Public: No */ -params ["_unit"]; -TRACE_2("params",_unit,typeOf _unit); - // only run this after the settings are initialized if !(EGVAR(common,settingsInitFinished)) exitWith { EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addEarPlugs), _this]; }; -// Exit if hearing is disabled OR autoAdd is disabled OR soldier has earplugs already in (persistence scenarios) -if (!GVAR(enableCombatDeafness) || {!GVAR(autoAddEarplugsToUnits)} || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {}; +// Exit if hearing is disabled or if autoAdd is disabled +if (!GVAR(enableCombatDeafness) || {GVAR(autoAddEarplugsToUnits) == 0}) exitWith {}; -// add earplugs if the soldier has a rocket launcher -if ((secondaryWeapon _unit) != "") exitWith { +params ["_unit"]; +TRACE_2("params",_unit,typeOf _unit); + +// Exit if the unit already has earplugs (in ears (persistence scenarios) or inventory) +if (_unit call FUNC(hasEarPlugsIn) || {[_unit, "ACE_EarPlugs"] call EFUNC(common,hasItem)}) exitWith {}; + +// Add earplugs if enabled for everyone or if the soldier has a rocket launcher +if (GVAR(autoAddEarplugsToUnits) == 2 || {(secondaryWeapon _unit) != ""}) exitWith { TRACE_1("has launcher - adding",_unit); _unit addItem "ACE_EarPlugs"; }; @@ -38,17 +41,21 @@ if ((primaryWeapon _unit) == "") exitWith {}; (primaryWeaponMagazine _unit) params [["_magazine", ""]]; if (_magazine == "") exitWith {}; -private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); -private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); -private _count = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); +private _cfgMagazine = configFile >> "CfgMagazines" >> _magazine; -private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); +private _initSpeed = getNumber (_cfgMagazine >> "initSpeed"); +private _ammo = getText (_cfgMagazine >> "ammo"); +private _count = getNumber (_cfgMagazine >> "count"); + +private _cfgAmmo = configFile >> "CfgAmmo"; + +private _caliber = getNumber (_cfgAmmo >> _ammo >> "ACE_caliber"); _caliber = call { - if (_ammo isKindOf ["ShellBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; - if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; - if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - if (_caliber <= 0) then { 6.5 } else { _caliber }; + if (_ammo isKindOf ["ShellBase", _cfgAmmo]) exitWith { 80 }; + if (_ammo isKindOf ["RocketBase", _cfgAmmo]) exitWith { 200 }; + if (_ammo isKindOf ["MissileBase", _cfgAmmo]) exitWith { 600 }; + if (_ammo isKindOf ["SubmunitionBase", _cfgAmmo]) exitWith { 80 }; + [_caliber, 6.5] select (_caliber <= 0); }; private _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 98ee093381..4dd81862b9 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -27,7 +27,9 @@ params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"]; if (_weapon in ["Throw", "Put"]) exitWith {}; if (_distance > 50) exitWith {}; -private _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; +private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select ( + (ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player} +); private _distance = 1 max _distance; private _silencer = switch (_weapon) do { @@ -51,7 +53,7 @@ if (isNil "_loudness") then { private _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); _weaponMagazines append _muzzleMagazines; }; - } count _muzzles; + } forEach _muzzles; { private _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); _weaponMagazines set [_forEachIndex, [_x, _ammoType]]; @@ -63,7 +65,7 @@ if (isNil "_loudness") then { if (_ammoType == _ammo) exitWith { _magazine = _magazineType; }; - } count _weaponMagazines; + } forEach _weaponMagazines; if (_magazine == "") then { _loudness = 0; @@ -78,7 +80,7 @@ if (isNil "_loudness") then { if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - if (_caliber <= 0) then { 6.5 } else { _caliber }; + [_caliber, 6.5] select (_caliber <= 0) }; _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; diff --git a/addons/hearing/initKeybinds.inc.sqf b/addons/hearing/initKeybinds.inc.sqf new file mode 100644 index 0000000000..22cf132add --- /dev/null +++ b/addons/hearing/initKeybinds.inc.sqf @@ -0,0 +1,15 @@ +["ACE3 Equipment", QGVAR(putOrRemoveEarplugs), LLSTRING(PutOrRemoveEarplugs), { + // Conditions: specific + if !([ACE_player, objNull, ["isNotSwimming", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + + if (GVAR(EnableCombatDeafness) && {!([ACE_player] call FUNC(hasEarPlugsIn))} && {[ACE_player, "ACE_EarPlugs"] call EFUNC(common,hasItem)}) exitWith { + [ACE_player, true] call FUNC(putInEarPlugs); + true + }; + if (GVAR(EnableCombatDeafness) && {[ACE_player] call FUNC(hasEarPlugsIn)}) exitWith { + [ACE_player, true] call FUNC(removeEarPlugs); + true + }; + + false +}] call CBA_fnc_addKeybind; // UNBOUND diff --git a/addons/hearing/initSettings.inc.sqf b/addons/hearing/initSettings.inc.sqf index f22a7b4eda..61b6d239c5 100644 --- a/addons/hearing/initSettings.inc.sqf +++ b/addons/hearing/initSettings.inc.sqf @@ -5,7 +5,9 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; [LSTRING(EnableCombatDeafness_DisplayName), LSTRING(EnableCombatDeafness_Description)], _category, true, - 1 + 1, + {[QGVAR(enableCombatDeafness), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -41,9 +43,9 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; ] call CBA_fnc_addSetting; [ - QGVAR(autoAddEarplugsToUnits), "CHECKBOX", + QGVAR(autoAddEarplugsToUnits), "LIST", [LSTRING(autoAddEarplugsToUnits_DisplayName), LSTRING(autoAddEarplugsToUnits_Description)], _category, - true, + [[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(heavyWeaponUnits), ELSTRING(common,Enabled)], 1], 1 ] call CBA_fnc_addSetting; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 7c40f3f702..1265478639 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -45,7 +45,7 @@ Füldugó berakva Protetores colocados Indossa i tappi auricolari - 耳栓を着ける + 耳栓を装着 귀마개 착용 塞入耳塞 塞入耳塞 @@ -79,7 +79,7 @@ Füldugó berakva Protetores colocados Tappi auricolari indossati - 耳栓を着けました + 耳栓を装着しました 귀마개 착용 耳塞已塞入 耳塞已塞入 @@ -144,7 +144,7 @@ Quando il giocatore riceve danni all'udito, non far sentire il fischio nelle orecchie Remove o efeito de zunido quando o jogador recebe dano na audição Убирает эффект звона в ушах, когда игрок получает повреждение слуха - プレイヤーの聴覚が損傷したときの耳鳴り効果を削除します + プレイヤーが聴覚にダメージを受けた際の耳鳴り効果音を無効化します 플레이어가 청력손실을 입을 때 생기는 이명현상을 제거합니다. 关闭耳鸣效果时,就算玩家受到相当程度的听力伤害,也不会造成耳鸣效果 關閉耳鳴效果時,就算玩家受到相當程度的聽力傷害, 也不會造成耳鳴效果 @@ -192,7 +192,7 @@ Уменьшает возможность игрока слышать звуки при повреждении органов слуха Assorda il giocatore quando riceve danni all'udito Réduit la capacité auditive du joueur lorsqu'il subit des dommages auditifs. - プレイヤーが聴覚ダメージを受けると聴力が低下します + プレイヤーが聴覚にダメージを受けると聴力が低下します 청력에 손상을 입으면 듣는 소리가 감소합니다. 当玩家听力受损时降低听力能力? 當玩家聽力受損時降低聽力能力? @@ -268,7 +268,7 @@ Aggiungi l'oggetto 'ACE_EarPlugs' a tutte le unità che hanno armi/lanciatori rumorosi. Può essere disabilitato se vengono usati loadout personalizzati. Agregar el item `ACE_EarPlugs` a todas las unidades equipadas con armas muy ruidosas. Desactivar si quieren utilizarse equipamientos personalizados. Ajoute l'objet `Ace_EarPlugs` à toutes les unités ayant des armes bruyantes. Peut être désactivé si de l'équipement personnalisé est utilisé. - 全ユニットへ`ACE_EarPlugs`アイテムを持たせます。これはロードアウトの編集で無効化できます。 + 全てのユニットに`ACE_EarPlugs`アイテムを所持させます。これはロードアウトの編集で無効化できます。 무기를 가지고 있는 모든 인원에게 'ACE_EarPlugs'를 지급합니다. 임의의 장비를 사용시 비활성화할 수 있습니다. 增加`ACE_EarPlugs`物品给拥有巨大噪音武器的单位。当你想自定装备时,此功能可被关闭。 增加`ACE_EarPlugs`物品給擁有巨大噪音武器的單位。當你想自定裝備時,此功能可被關閉。 @@ -292,7 +292,7 @@ Volume muffling Lautstärkedämpfung Atténuation du volume - 音量低下 + 音量の抑制 降低音量 進低音量 Attenuazione del volume @@ -306,7 +306,7 @@ Earplugs Volume Lautstärke Ohrenstöpsel - 耳栓時の音量 + 耳栓装着時音量 耳塞时音量 耳塞時音量 Volume con i Tappi @@ -321,7 +321,7 @@ Volume when using earplugs. Lautstärke wenn man Ohrenstöpsel benutzt - 耳栓使用時の音量を決定します。 + 耳栓を使用した時の音量。 决定带上耳塞时的音量 使用耳塞時音量 Volume audio quandi si indossano i tappi per le orecchie. @@ -336,7 +336,7 @@ Unconscious Volume Lautstärke Bewusstlosigkeit - 気絶時の音量 + 無意識状態時音量 无意识时音量 昏迷時音量 Volume quando incoscente @@ -351,7 +351,7 @@ Volume when unconscious. Lautstärke während man Bewusstlos ist - 無意識状態時の音量を決定します。 + 無意識状態になった時の音量。 决定处于无意识时的音量 昏迷時使用耳塞的音量 Volume quando incoscente. @@ -363,5 +363,19 @@ Volumen durante la inconsciencia. 기절 시 볼륨입니다. + + Put/take out earplugs + 耳栓の着脱 + Вставить/вынуть беруши + Metti/Togli tappi + 귀마개 토글 + Mettre/enlever les bouchons + + + Only units with heavy weapons + Uniquement les unités dotées d'armes lourdes + Только юниты с тяжелым вооружением + 重火器を装備したユニットのみ + diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index 28dda99086..26bc3f1ff0 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -93,5 +93,5 @@ if (_attackStage >= 3 && { _seekerType isEqualTo "ARH" }) then { }; }; -// TRACE_1("Adjusted target position", _returnTargetPos); +// TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf index fb12cad00f..14d89f82e3 100644 --- a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -31,11 +31,10 @@ private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeigh private _startingStage = if (_configLaunchHeightClear > 0) then { STAGE_LAUNCH; // LOAL-HI / LO } else { - if (_seekerTargetPos isEqualTo [0,0,0]) then { - STAGE_SEEK_CRUISE; // LOAL-DIR - } else { - STAGE_ATTACK_CRUISE // LOBL - }; + [ + STAGE_ATTACK_CRUISE, + STAGE_SEEK_CRUISE + ] select (_seekerTargetPos isEqualTo [0,0,0]); }; // Set data in param array diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 54b6516fff..411dbfe30e 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -77,8 +77,7 @@ GVAR(no_cams) sort true; if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then { GVAR(no_cams) pushBack _x; }; - true - } count GVAR(nearHuntIRs); + } forEach GVAR(nearHuntIRs); { if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then { GVAR(no_cams) deleteAt _forEachIndex; @@ -145,7 +144,7 @@ GVAR(no_cams) sort true; GVAR(cam) camCommit 0; ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]]; - ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]]; + ctrlSetText [2, str (GVAR(cur_cam) + 1)]; private _cam_time = CBA_missionTime - (GVAR(huntIR) getVariable [QGVAR(startTime), CBA_missionTime]); ctrlSetText [3, format["%1 s", round(_cam_time)]]; private _cam_pos = getPosVisual GVAR(huntIR); diff --git a/addons/intelitems/XEH_preInit.sqf b/addons/intelitems/XEH_preInit.sqf index 76f13135d9..ff09f6ea0e 100644 --- a/addons/intelitems/XEH_preInit.sqf +++ b/addons/intelitems/XEH_preInit.sqf @@ -18,8 +18,8 @@ if (isServer) then { GVAR(intelData) = [true] call CBA_fnc_createNamespace; publicVariable QGVAR(intelData); - [QGVAR(handleMagIndex), FUNC(handleMagIndex)] call CBA_fnc_addEventHandler; - [QGVAR(setObjectData), FUNC(setObjectData)] call CBA_fnc_addEventHandler; + [QGVAR(handleMagIndex), LINKFUNC(handleMagIndex)] call CBA_fnc_addEventHandler; + [QGVAR(setObjectData), LINKFUNC(setObjectData)] call CBA_fnc_addEventHandler; }; if (hasInterface) then { diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index a76bf90e1c..5c9a2ecae0 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -47,7 +47,7 @@ GVAR(ParsedTextCached) = []; }] call CBA_fnc_addEventHandler; //Add Actions to Houses: -["ace_interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call CBA_fnc_addEventHandler; +["ace_interactMenuOpened", LINKFUNC(userActions_addHouseActions)] call CBA_fnc_addEventHandler; ["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)), { diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index b60f1bb745..bf3278f0a3 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -10,7 +10,7 @@ PREP_RECOMPILE_END; if (!hasInterface) exitWith { ADDON = true; }; -["All", "init", {_this call FUNC(compileMenu)}] call CBA_fnc_addClassEventHandler; +["All", "init", LINKFUNC(compileMenu)] call CBA_fnc_addClassEventHandler; GVAR(ActNamespace) = [] call CBA_fnc_createNamespace; GVAR(ActSelfNamespace) = [] call CBA_fnc_createNamespace; diff --git a/addons/interact_menu/functions/fnc_addActionToZeus.sqf b/addons/interact_menu/functions/fnc_addActionToZeus.sqf index b4dbb69f4a..3175bf14ad 100644 --- a/addons/interact_menu/functions/fnc_addActionToZeus.sqf +++ b/addons/interact_menu/functions/fnc_addActionToZeus.sqf @@ -19,7 +19,7 @@ if (!hasInterface) exitWith { [] }; if (!params [["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith {ERROR("Bad Params"); []}; -if ((_parentPath param [0, ""]) != "ACE_ZeusActions") exitWith {ERROR_1("Bad path %1 - should have ACE_ZeusActions as base", _parentPath); []}; +if ((_parentPath param [0, ""]) != "ACE_ZeusActions") exitWith {ERROR_1("Bad path %1 - should have ACE_ZeusActions as base",_parentPath); []}; TRACE_2("addActionToZeus",_parentPath,_action); private _currentPath = GVAR(ZeusActions); @@ -37,7 +37,7 @@ private _pathValid = false; } forEach _currentPath; } forEach _parentPath; -if (!_pathValid) exitWith {ERROR_1("Bad path %1", _parentPath); []}; +if (!_pathValid) exitWith {ERROR_1("Bad path %1",_parentPath); []}; TRACE_1("Adding Action",_currentPath); _currentPath pushBack [_action, []]; diff --git a/addons/interact_menu/functions/fnc_addMainAction.sqf b/addons/interact_menu/functions/fnc_addMainAction.sqf index 86b37bf416..83349c21b3 100644 --- a/addons/interact_menu/functions/fnc_addMainAction.sqf +++ b/addons/interact_menu/functions/fnc_addMainAction.sqf @@ -27,7 +27,7 @@ if (isNil "_actionTrees") then { private _parentNode = [_actionTrees, ["ACE_MainActions"]] call FUNC(findActionNode); if (isNil {_parentNode}) then { - TRACE_2("No Main Action on object", _objectType, _typeNum); + TRACE_2("No Main Action on object",_objectType,_typeNum); private _mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call FUNC(createAction); [_objectType, _typeNum, [], _mainAction] call EFUNC(interact_menu,addActionToClass); }; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 82235493e6..9a3eb31598 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -43,12 +43,21 @@ _origActionData params [ "_distance" ]; +private _result = [_target, ACE_player, _customParams] call _conditionCode; + +// Handle nil as false +if (isNil "_result") then { + ERROR_1("Action [%1] bad condition return",_actionName); + + _result = false; +}; + // Return nothing if the action itself is not active -if !([_target, ACE_player, _customParams] call _conditionCode) exitWith { +if (!_result) exitWith { [] }; -// Return nothing if the action is to far (including checking sub actions) [DISABLED FOR NOW ref #2196] +// Return nothing if the action is too far (including checking sub actions) [DISABLED FOR NOW ref #2196] // if (_distanceToBasePoint > _distance) exitWith { // [] // }; @@ -64,21 +73,19 @@ if (_insertChildrenCode isNotEqualTo {}) then { // Collect dynamic children class actions { private _action = [_x select 2, _x, _fullPath, _distanceToBasePoint] call FUNC(collectActiveActionTree); - if ((count _action) > 0) then { + if (_action isNotEqualTo []) then { _activeChildren pushBack _action; }; - nil - } count _dynamicChildren; + } forEach _dynamicChildren; }; // Collect children class actions { private _action = [_object, _x, _fullPath, _distanceToBasePoint] call FUNC(collectActiveActionTree); - if ((count _action) > 0) then { + if (_action isNotEqualTo []) then { _activeChildren pushBack _action; }; - nil -} count _origActionChildren; +} forEach _origActionChildren; // Collect children object actions { @@ -87,12 +94,11 @@ if (_insertChildrenCode isNotEqualTo {}) then { // Check if the action is children of the original action if (_pPath isEqualTo _fullPath) then { private _action = [_object, [_actionData,[]], _fullPath, _distanceToBasePoint] call FUNC(collectActiveActionTree); - if ((count _action) > 0) then { + if (_action isNotEqualTo []) then { _activeChildren pushBack _action; }; }; - nil -} count GVAR(objectActionList); +} forEach GVAR(objectActionList); // If the original action has no statement, and no children, don't display it @@ -103,14 +109,14 @@ if ((_activeChildren isEqualTo []) && {_statementCode isEqualTo {}}) exitWith { if (GVAR(consolidateSingleChild) && {count _activeChildren == 1} && {_statementCode isEqualTo {}}) then { _activeChildren select 0 params ["_childActionData", "_childChildren", "_childObject"]; - _childActionData params ["", "_displayNameChild", "_iconChild", "_statementChild", "", "", "_customParamsChild", "", "", "_paramsChild"]; + _childActionData params ["", "_displayNameChild", "_iconChild", "_statementChild", "_conditionChild", "_insertChildrenChild", "_customParamsChild", "", "", "_paramsChild"]; _origActionData = [ _actionName, format ["%1 > %2", _displayName, _displayNameChild], _iconChild, _statementChild, - _conditionCode, - _insertChildrenCode, + _conditionChild, + _insertChildrenChild, _customParamsChild, _position, _distance, diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 35b0ea7177..75d759465c 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -45,7 +45,7 @@ private _recurseFnc = { private _displayName = getText (_entryCfg >> "displayName"); private _distance = _parentDistance; if (isNumber (_entryCfg >> "distance")) then {_distance = getNumber (_entryCfg >> "distance");}; - // if (_distance < _parentDistance) then {WARNING_3("[%1] distance %2 less than parent %3", configName _entryCfg, _distance, _parentDistance);}; + // if (_distance < _parentDistance) then {WARNING_3("[%1] distance %2 less than parent %3",configName _entryCfg,_distance,_parentDistance);}; private _icon = if (isArray (_entryCfg >> "icon")) then { getArray (_entryCfg >> "icon"); } else { @@ -74,7 +74,7 @@ private _recurseFnc = { if (_condition isEqualTo "") then {_condition = "true"}; } else { // Add canInteract (including exceptions) and canInteractWith to condition - private _canInteractCondition = format [QUOTE([ARR_3(ACE_player,_target,%1)] call EFUNC(common,canInteractWith)), getArray (_entryCfg >> "exceptions")]; + private _canInteractCondition = format [QUOTE([ARR_3(ACE_player,_target,%1)] call EFUNC(common,canInteractWith)),getArray (_entryCfg >> "exceptions")]; private _conditionFormatPattern = ["%1 && {%2}", "%2"] select (_condition isEqualTo "" || {_condition == "true"}); _condition = format [_conditionFormatPattern, _condition, _canInteractCondition]; }; @@ -114,8 +114,7 @@ private _recurseFnc = { ]; _actions pushBack _entry; }; - nil - } count (configProperties [_actionsCfg, "isClass _x", true]); + } forEach (configProperties [_actionsCfg, "isClass _x", true]); _actions }; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 75fdb93819..ed3a02dd14 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -84,8 +84,7 @@ private _recurseFnc = { ]; _actions pushBack _entry; }; - nil - } count (configProperties [_actionsCfg, "isClass _x", true]); + } forEach (configProperties [_actionsCfg, "isClass _x", true]); _actions }; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index d920922ddb..ae00f4fb82 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -49,7 +49,7 @@ _position = if (_position isEqualType "") then { } else { if (_position isEqualType []) then { // If the action is set to a array position, create the suitable code - compile format ["%1", _position]; + compile str _position; } else { _position; }; diff --git a/addons/interact_menu/functions/fnc_createVehiclesActions.sqf b/addons/interact_menu/functions/fnc_createVehiclesActions.sqf index 54f92967c2..3aef7b4552 100644 --- a/addons/interact_menu/functions/fnc_createVehiclesActions.sqf +++ b/addons/interact_menu/functions/fnc_createVehiclesActions.sqf @@ -30,6 +30,6 @@ _vehicles apply { _name = format ["%1 (%2m)", _name, _distanceStr]; }; private _icon = [_x] call EFUNC(common,getVehicleIcon); - private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); + private _action = [str _x, _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); [_action, [], _target] } diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 55aa0f4f82..6772b61c54 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -35,7 +35,7 @@ if (isNil {_parentNode}) exitWith {}; private _found = false; { if (((_x select 0) select 0) == _actionName) exitWith { - TRACE_2("Deleting Action", _forEachIndex, _x); + TRACE_2("Deleting Action",_forEachIndex,_x); _found = true; (_parentNode select 1) deleteAt _forEachIndex; }; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index e7bb42b4cf..3aa8a05ab3 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -95,7 +95,7 @@ if (_useListMenu) then { _scaleX = _textSize * 0.17 * 1.1; _scaleY = 0.17 * 0.30 * 4/3; } else { - private _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; + private _textSIze = [1, 1.3] select (GVAR(textSize) > 2); _scaleX = _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); _scaleY = _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 75e92c02c9..f461e2a770 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -78,7 +78,7 @@ ACE_Modifier = 0; }] call CBA_fnc_addEventHandler; if (isServer) then { - [QGVAR(replaceTerrainObject), FUNC(replaceTerrainObject)] call CBA_fnc_addEventHandler; + [QGVAR(replaceTerrainObject), LINKFUNC(replaceTerrainObject)] call CBA_fnc_addEventHandler; }; if (!hasInterface) exitWith {}; @@ -136,7 +136,7 @@ GVAR(isOpeningDoor) = false; if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; //Tap whichever shoulder is closest - private _shoulderNum = [0, 1] select (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180); + private _shoulderNum = parseNumber (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180); // Statement [ACE_player, cursorTarget, _shoulderNum] call FUNC(tapShoulder); @@ -168,7 +168,7 @@ private _action = [ // action display name will be overwritten in modifier function QGVAR(takeWeapon), "take", "\A3\ui_f\data\igui\cfg\actions\take_ca.paa", {_player action ["TakeWeapon", _target, weaponCargo _target select 0]}, - {count weaponCargo _target == 1}, + {(count weaponCargo _target == 1) && {[_player, objNull, []] call EFUNC(common,canInteractWith)}}, // Not checking if container is claimed nil, nil, nil, nil, nil, { params ["_target", "", "", "_actionData"]; diff --git a/addons/interaction/XEH_preStart.sqf b/addons/interaction/XEH_preStart.sqf index 799e9e5986..331b5c6d36 100644 --- a/addons/interaction/XEH_preStart.sqf +++ b/addons/interaction/XEH_preStart.sqf @@ -11,7 +11,7 @@ private _replaceTerrainClasses = QUOTE( private _cacheReplaceTerrainModels = createHashMap; { - private _model = toLower getText (_x >> "model"); + private _model = toLowerANSI getText (_x >> "model"); if (_model select [0, 1] == "\") then { _model = _model select [1]; }; diff --git a/addons/interaction/dev/initReplaceTerrainCursorObject.sqf b/addons/interaction/dev/initReplaceTerrainCursorObject.sqf index ee5ddcad49..a1708be423 100644 --- a/addons/interaction/dev/initReplaceTerrainCursorObject.sqf +++ b/addons/interaction/dev/initReplaceTerrainCursorObject.sqf @@ -17,7 +17,7 @@ DFUNC(replaceTerrainModelsAdd) = { if (_class isEqualTo "") then { private _configClasses = QUOTE(getNumber (_x >> 'scope') == 2 && {!(configName _x isKindOf 'AllVehicles')}) configClasses (configFile >> "CfgVehicles"); { - private _xmodel = toLower getText (_x >> "model"); + private _xmodel = toLowerANSI getText (_x >> "model"); if (_xmodel select [0, 1] == "\") then { _xmodel = _xmodel select [1]; }; diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 112919ee80..a3d8c2eff0 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -33,7 +33,6 @@ private _actions = []; _x params ["_actionData", "_children"]; _actions pushBack [_actionData, _children, _unit]; - false -} count (_actionTrees select 0 select 1); +} forEach (_actionTrees select 0 select 1); _actions diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 40ba9672ef..50b0d98a21 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -43,7 +43,7 @@ private _icon = ""; _actions pushBack [ [ - format ["%1", _unit], + str _unit, [_unit, true] call EFUNC(common,getName), [_icon, "#FFFFFF"], { diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 02daf57a83..5f251d2589 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -33,7 +33,7 @@ if (typeOf _house == "") exitWith {[objNull, ""]}; _intersections = [_house, "GEOM"] intersect [_position0, _position1]; -private _door = toLower (_intersections select 0 select 0); +private _door = toLowerANSI (_intersections select 0 select 0); if (isNil "_door") exitWith {[_house, ""]}; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index 2d5c81dc2d..b91c5eac6c 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -26,8 +26,8 @@ private _lockedVariable = []; private _numberStrings = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; { - private _animName = toLower _x; - private _index = _animName find toLower _door; + private _animName = toLowerANSI _x; + private _index = _animName find toLowerANSI _door; if (_index != -1 && {!(_animName select [_index + count _door, 1] in _numberStrings)}) then { if (((_animName find "disabled") != -1) || ((_animName find "locked") != -1)) then { diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index b8f6d7c50d..531cd23c54 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -22,11 +22,10 @@ params ["_unit", "_target"]; [_unit, "GestureGo"] call EFUNC(common,doGesture); -private _chance = [0.5, 0.8] select (count weapons _unit > 0); +private _chance = [0.5, 0.8] select (weapons _unit isNotEqualTo []); { - if (count weapons _x == 0 && {random 1 < _chance}) then { + if (weapons _x isEqualTo [] && {random 1 < _chance}) then { [QGVAR(getDown), [_x], [_x]] call CBA_fnc_targetEvent; }; - false -} count (_target nearEntities ["Civilian", SEND_RADIUS]); +} forEach (_target nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_getGlassDoor.sqf b/addons/interaction/functions/fnc_getGlassDoor.sqf index ffa6bfec44..2aea74f82d 100644 --- a/addons/interaction/functions/fnc_getGlassDoor.sqf +++ b/addons/interaction/functions/fnc_getGlassDoor.sqf @@ -26,7 +26,7 @@ private _glassDoor = _door splitString "_"; private _glassPos = (_house selectionPosition [(_glassDoor select 0) + "_" + (_glassDoor select 1) + "_effects", "Memory"]); // Calculate all animation names so we know what is there { - private _animName = toLower _x; + private _animName = toLowerANSI _x; if (((_animName find "door") != -1) && ((_animName find "locked") == -1) && ((_animName find "disabled") == -1) && ((_animName find "handle") == -1)) then { private _splitStr = _animName splitString "_"; _doorParts pushBack ((_splitStr select 0) + "_" + (_splitStr select 1) + "_trigger"); @@ -64,4 +64,3 @@ private _lowestDistance = 0; if ((isNil "_door") || ((_door find "glass") != -1)) exitWith {}; _door - diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index a03ca26c04..11b9c67c91 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -35,12 +35,12 @@ if (_animations isEqualTo []) exitWith {}; private _lockedVariable = format ["bis_disabled_%1", _door]; private _lockedVariableAlt = _lockedVariable; // GM Buildings may have door names like door_01 but locking expects door_1 -if ((count _door == 7) && {(_door select [0, 6]) == "door_0"}) then { +if ((count _door == 7) && {(_door select [0, 6]) == "door_0"}) then { _lockedVariableAlt = format ["bis_disabled_door_%1", _door select [6, 1]]; // stip off the leading zero then check both vars }; // Check if the door can be locked aka have locked variable, otherwhise cant lock it -if ((_house animationPhase (_animations select 0) <= 0) && +if ((_house animationPhase (_animations select 0) <= 0) && {(_house getVariable [_lockedVariable, 0] == 1) || {_house getVariable [_lockedVariableAlt, 0] == 1}}) exitWith { private _lockedAnimation = format ["%1_locked_source", _door]; TRACE_3("locked",_house,_lockedAnimation,isClass (configOf _house >> "AnimationSources" >> _lockedAnimation)); @@ -63,18 +63,24 @@ GVAR(doorTargetPhase) = _house animationPhase (_animations select 0); GVAR(isOpeningDoor) = true; GVAR(usedScrollWheel) = false; +// Raise local started opening event +[QGVAR(doorOpeningStarted), [_house, _door, _animations]] call CBA_fnc_localEvent; + [{ - (_this select 0) params ["_house", "_animations", "_position", "_time", "_frame"]; + (_this select 0) params ["_house", "_animations", "_position", "_time", "_frame", "_door"]; if !(GVAR(isOpeningDoor)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; // didn't use incremental opening. Just do animation normally. if !(GVAR(usedScrollWheel)) then { - private _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + private _phase = parseNumber (_house animationPhase (_animations select 0) < 0.5); - {_house animate [_x, _phase]; false} count _animations; + {_house animate [_x, _phase]} forEach _animations; }; + + // Raise local stopped opening event + [QGVAR(doorOpeningStopped), [_house, _door, _animations]] call CBA_fnc_localEvent; }; // check if player moved too far away @@ -87,5 +93,5 @@ GVAR(usedScrollWheel) = false; GVAR(usedScrollWheel) = true; }; // do incremental door opening - {_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations; -}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler; + {_house animate [_x, GVAR(doorTargetPhase)]} forEach _animations; +}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2, _door]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf index 09513b4762..8750078502 100644 --- a/addons/interaction/functions/fnc_passMagazine.sqf +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -7,6 +7,7 @@ * 0: Unit that passes the magazine * 1: Unit to pass the magazine to * 2: Weapon classname + * 3: Play passing animation (default: true) * * Return Value: * None @@ -16,7 +17,7 @@ * * Public: No */ -params ["_player", "_target", "_weapon"]; +params ["_player", "_target", "_weapon", ["_animate", true, [true]]]; private _compatibleMags = [_weapon] call CBA_fnc_compatibleMagazines; private _filteredMags = magazinesAmmoFull _player select { @@ -35,18 +36,12 @@ private _magToPassIndex = 0; }; } foreach _filteredMags; -//remove all magazines and add them again, except the one to be passed -//needed because of missing commands, see http://feedback.arma3.com/view.php?id=12782 +//remove the magazine from _player and add it to _target _magToPass params ["_magToPassClassName", "_magToPassAmmoCount"]; -_player removeMagazines _magToPassClassName; -{ - _x params ["_className", "_ammoCount"]; - if ((_className == _magToPassClassName) && (_forEachIndex != _magToPassIndex)) then { - _player addMagazine [_className, _ammoCount]; - }; -} foreach _filteredMags; +// Exit if failed to remove specific magazine +if !([_player, _magToPassClassName, _magToPassAmmoCount] call EFUNC(common,removeSpecificMagazine)) exitWith {}; -[_player, "PutDown"] call EFUNC(common,doGesture); +if (_animate) then {[_player, "PutDown"] call EFUNC(common,doGesture)}; _target addMagazine [_magToPassClassName, _magToPassAmmoCount]; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index cef314756f..b986ea2661 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -22,14 +22,13 @@ params ["_unit"]; [_unit, "GestureGo"] call EFUNC(common,doGesture); -private _chance = [0.5, 0.8] select (count weapons _unit > 0); +private _chance = [0.5, 0.8] select (weapons _unit isNotEqualTo []); { - if (count weapons _x == 0 && {random 1 < _chance}) then { + if (weapons _x isEqualTo [] && {random 1 < _chance}) then { private _position = getPosASL _unit vectorAdd (eyeDirection _unit vectorMultiply SEND_DISTANCE); _position set [2, 0]; [QGVAR(sendAway), [_x, _position], [_x]] call CBA_fnc_targetEvent; }; - false -} count (_unit nearEntities ["Civilian", SEND_RADIUS]); +} forEach (_unit nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 73567fa522..9adc15f493 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -71,7 +71,7 @@ if (_textMMB == "") then { // Only create extra key if both name and text are valid if (_keyName != "" && {_keyText != ""}) then { // Localize Ctrl, Shift, or Alt keys - switch (toLower _keyName) do { + switch (toLowerANSI _keyName) do { case "ctrl"; case "control": {_keyName = format ["<%1>", toUpper localize "STR_dik_control"]}; case "shift": {_keyName = format ["<%1>", toUpper localize "STR_dik_shift"]}; diff --git a/addons/inventory/CfgEventHandlers.hpp b/addons/inventory/CfgEventHandlers.hpp index 5b92811746..f95adcb029 100644 --- a/addons/inventory/CfgEventHandlers.hpp +++ b/addons/inventory/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); @@ -20,5 +19,12 @@ class Extended_PostInit_EventHandlers { class Extended_DisplayLoad_EventHandlers { class RscDisplayInventory { ADDON = QUOTE(_this call FUNC(inventoryDisplayLoad)); + GVAR(displayNameWeight) = QUOTE(_this call FUNC(displayNameWeight)); // separate to allow other mods to disable them individually + }; +}; + +class Extended_DisplayUnload_EventHandlers { + class RscDisplayInventory { + ADDON = QUOTE(GVAR(unit) = ACE_player); }; }; diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp index 3149000777..91e68f5fb1 100644 --- a/addons/inventory/RscDisplayInventory.hpp +++ b/addons/inventory/RscDisplayInventory.hpp @@ -27,26 +27,26 @@ class RscCombo; #define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) #define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) -#define X_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)),0)]),X_BIS(num),X_MAKEITBIGGA(num))]) -#define Y_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)),0)]),Y_BIS(num),Y_MAKEITBIGGA(num))]) -#define W_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)),0)]),W_BIS(num),W_MAKEITBIGGA(num))]) -#define H_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)),0)]),H_BIS(num),H_MAKEITBIGGA(num))]) +#define X_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QQGVAR(inventoryDisplaySize),0)]),X_BIS(num),X_MAKEITBIGGA(num))]) +#define Y_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QQGVAR(inventoryDisplaySize),0)]),Y_BIS(num),Y_MAKEITBIGGA(num))]) +#define W_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QQGVAR(inventoryDisplaySize),0)]),W_BIS(num),W_MAKEITBIGGA(num))]) +#define H_PART(num) QUOTE(linearConversion [ARR_5(0,2,(missionNamespace getVariable [ARR_2(QQGVAR(inventoryDisplaySize),0)]),H_BIS(num),H_MAKEITBIGGA(num))]) class RscDisplayInventory { class controls { class CA_ContainerBackground: RscText { - //crate: GroundLoad adjust size + // Crate: GroundLoad adjust size x = X_PART(1); y = Y_PART(1); w = W_PART(12); - h = H_PART(22.5); //default 23 + h = H_PART(22.5); // default 23 }; class CA_PlayerBackground: RscText { - //center player's container: decrease height because of progressbar height decrease + // Center player's container: Decrease height because of progressbar height decrease x = X_PART(14.6); y = Y_PART(2); w = W_PART(24.4); - h = H_PART(21.5); //default 22 + h = H_PART(21.5); // default 22 }; class TitleBackground: RscText { x = X_PART(14.6); @@ -98,7 +98,7 @@ class RscDisplayInventory { }; class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary { x = X_PART(30.6); - y = Y_PART(9.2); //not sure why different (double check release) + y = Y_PART(9.2); // not sure why different (double check release) w = W_PART(1.9); h = H_PART(2); }; @@ -283,11 +283,11 @@ class RscDisplayInventory { h = H_PART(1); }; class GroundLoad: RscProgress { - //crate: GroundLoad adjust size + // Crate: GroundLoad adjust size x = X_PART(1.5); y = Y_PART(22.5); w = W_PART(11); - h = H_PART(0.5); //Default 1 + h = H_PART(0.5); // Default 1 }; class SlotPrimary: GroundTab { x = X_PART(26.6); @@ -345,7 +345,7 @@ class RscDisplayInventory { }; class SlotSecondaryUnderBarrel: SlotPrimary { x = X_PART(29); - y = Y_PART(14.59); //Why is this different? (check release) + y = Y_PART(14.59); // Why is this different? (check release) w = W_PART(2.3); h = H_PART(2); }; @@ -518,11 +518,11 @@ class RscDisplayInventory { h = H_PART(0.5); }; class TotalLoad: GroundLoad { - //center: progressbar height decrease + // Center: progressbar height decrease x = X_PART(15.1); y = Y_PART(22.5); w = W_PART(23.4); - h = H_PART(0.5); //Default 1 + h = H_PART(0.5); // default 1 }; class ContainerMarker: GroundTab { x = X_PART(0); diff --git a/addons/inventory/XEH_PREP.hpp b/addons/inventory/XEH_PREP.hpp index 7c58268e23..824ebf63d7 100644 --- a/addons/inventory/XEH_PREP.hpp +++ b/addons/inventory/XEH_PREP.hpp @@ -1,10 +1,6 @@ - PREP(addCustomFilter); PREP(currentItemListBox); -PREP(forceItemListUpdate); -PREP(inventoryDisplayLoad); -PREP(onLBSelChanged); - +PREP(displayNameWeight); PREP(filterWeapons); PREP(filterMagazines); PREP(filterItems); @@ -14,3 +10,6 @@ PREP(filterVests); PREP(filterBackpacks); PREP(filterGrenades); PREP(filterMedical); +PREP(forceItemListUpdate); +PREP(inventoryDisplayLoad); +PREP(onLBSelChanged); diff --git a/addons/inventory/XEH_postInit.sqf b/addons/inventory/XEH_postInit.sqf index c5dc6c48f6..a670a7bfd5 100644 --- a/addons/inventory/XEH_postInit.sqf +++ b/addons/inventory/XEH_postInit.sqf @@ -2,40 +2,39 @@ if (!hasInterface) exitWith {}; -// cache config -// items in the inventory display can only be distinguished by their lb names and pictures -// this can cause collisions (mainly weapons with attachments), -// but if the item has the same name and picture it at least shouldn't change the filter anyway -// luckily we don't need private items, so dummy and parent classes are out of the picture +// If medical_treatment is loaded, get its items +if (["ace_medical_treatment"] call EFUNC(common,isModLoaded)) then { + private _medicalList = +(uiNamespace getVariable [QGVAR(medicalItemList), createHashMap]); -GVAR(ItemKeyNamespace) = [] call CBA_fnc_createNamespace; -private _allItems = uiNamespace getVariable [QGVAR(ItemKeyCache), []]; //See XEH_preStart.sqf + _medicalList merge [uiNamespace getVariable [QEGVAR(medical_treatment,treatmentItems), createHashMap], true]; -// isEqualType is hacking protection as we cannot trust that the cache hasn't been manipulated -{ - if (_x isEqualType [] && {_x isEqualTypeArray ["", configNull]}) then { - GVAR(ItemKeyNamespace) setVariable _x; - }; -} forEach ([[], _allItems] select (_allItems isEqualType [])); + GVAR(medicalItemList) = compileFinal _medicalList; +} else { + GVAR(medicalItemList) = uiNamespace getVariable [QGVAR(medicalItemList), compileFinal createHashMap]; +}; GVAR(customFilters) = []; GVAR(selectedFilterIndex) = -1; -// add custom filters +// Add custom filters +[LLSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter); +[LLSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter); +[LLSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter); +[LLSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter); +[LLSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter); +[LLSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter); -// get list of grenades -GVAR(Grenades_ItemList) = uiNamespace getVariable [QGVAR(Grenades_ItemList), []]; -if (!(GVAR(Grenades_ItemList) isEqualType [])) then {GVAR(Grenades_ItemList) = []}; +// Used for displaying the correct name when opening a subordinate's inventory +GVAR(unit) = ACE_player; -[localize LSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter); +["CAManBase", "InventoryOpened", { + params ["_unit", "_container"]; -[localize LSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter); -[localize LSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter); -[localize LSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter); -[localize LSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter); + // GVAR(unit) is ACE_player by default + if (_unit isEqualTo ACE_player) exitWith {}; -// get list of medical items -GVAR(Medical_ItemList) = uiNamespace getVariable [QGVAR(Medical_ItemList), []]; -if (!(GVAR(Medical_ItemList) isEqualType [])) then {GVAR(Medical_ItemList) = []}; - -[localize LSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter); + // If the player is a group leader and opens a subordinate's inventory or has a subordinate open the player's backpack, update name to correct unit + if (leader ACE_player == ACE_player && {(_unit in units ACE_player) || {(objectParent _container) isEqualTo ACE_player}}) then { + GVAR(unit) = _unit; + }; +}] call CBA_fnc_addClassEventHandler; diff --git a/addons/inventory/XEH_preStart.sqf b/addons/inventory/XEH_preStart.sqf index 82dabefaec..a9a634ab5a 100644 --- a/addons/inventory/XEH_preStart.sqf +++ b/addons/inventory/XEH_preStart.sqf @@ -2,56 +2,49 @@ #include "XEH_PREP.hpp" -//item cache, see XEH_postInit.sqf +// Cache config +// Items in the inventory display can all use lb data to get their classname (exception: backpacks, handled separately) private _allItems = ("getNumber (_x >> 'scope') > 0" configClasses (configFile >> "CfgWeapons")); _allItems append ("getNumber (_x >> 'scope') > 0" configClasses (configFile >> "CfgGlasses")); -_allItems append ("getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgMagazines")); -_allItems append ("getNumber (_x >> 'scope') > 0 && {getNumber (_x >> 'isBackpack') == 1}" configClasses (configFile >> "CfgVehicles")); +_allItems append ("getNumber (_x >> 'scope') > 0" configClasses (configFile >> "CfgMagazines")); -uiNamespace setVariable [QGVAR(ItemKeyCache), _allItems apply { +uiNamespace setVariable [QGVAR(itemKeyCache), compileFinal ((_allItems apply {configName _x}) createHashMapFromArray _allItems)]; + +// Backpacks in the inventory display can only be distinguished by their lb names and pictures, lb data returns "" +_allItems = "getNumber (_x >> 'scope') > 0 && {getNumber (_x >> 'isBackpack') == 1}" configClasses (configFile >> "CfgVehicles"); + +uiNamespace setVariable [QGVAR(backpackKeyCache), compileFinal createHashMapFromArray (_allItems apply { private _displayName = getText (_x >> "displayName"); private _picture = getText (_x >> "picture"); - // list box seems to delete the leading backslash - if (_picture select [0,1] == "\") then { + // List box seems to delete the leading backslash + if (_picture select [0, 1] == "\") then { _picture = _picture select [1]; }; - if (count _picture > 0 && !(_picture regexMatch ".*?\.paa")) then { // handle missing file extension + + // Handle missing file extension, as inventory returns path with extension + if (count _picture > 0 && !(_picture regexMatch ".*?\.paa")) then { if (!fileExists (_picture + ".paa")) exitWith {}; _picture = _picture + ".paa"; }; - [format ["%1:%2", _displayName, _picture], _x]; -}]; + // Listboxes store pictures as lowercase + [format ["%1:%2", _displayName, toLowerANSI _picture], _x] +})]; -// generate list of grenades -private _grenades_ItemList = []; +// Generate list of grenades +private _cfgThrow = configFile >> "CfgWeapons" >> "Throw"; +private _grenadeList = createHashMap; { - _grenades_ItemList append getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); -} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); + _grenadeList insert [true, (getArray (_cfgThrow >> _x >> "magazines")) apply {_x call EFUNC(common,getConfigName)}, []]; +} forEach getArray (_cfgThrow >> "muzzles"); -// make list case insensitive -_grenades_ItemList = _grenades_ItemList apply {toLower _x}; +uiNamespace setVariable [QGVAR(grenadesItemList), compileFinal _grenadeList]; -// filter duplicates -_grenades_ItemList = _grenades_ItemList arrayIntersect _grenades_ItemList; +// Generate list of medical items +private _medicalList = QUOTE(getNumber (_x >> 'scope') > 0 && {getNumber (_x >> 'ItemInfo' >> 'type') in [ARR_2(TYPE_FIRST_AID_KIT,TYPE_MEDIKIT)]}) configClasses (configFile >> "CfgWeapons"); -uiNamespace setVariable [QGVAR(Grenades_ItemList), _grenades_ItemList]; +_medicalList = _medicalList apply {configName _x}; -// generate list of medical items -private _medical_ItemList = ["FirstAidKit", "Medikit"]; -{ - _medical_ItemList append getArray (_x >> "items"); -} forEach ("true" configClasses (configFile >> QEGVAR(medical_treatment,Actions))); - -// remove all numbers from list -_medical_ItemList = _medical_ItemList select {_x isEqualType ""}; - -// make list case insensitive -_medical_ItemList = _medical_ItemList apply {toLower _x}; - -// filter duplicates -_medical_ItemList = _medical_ItemList arrayIntersect _medical_ItemList; - -uiNamespace setVariable [QGVAR(Medical_ItemList), _medical_ItemList]; +uiNamespace setVariable [QGVAR(medicalItemList), compileFinal (_medicalList createHashMapFromArray [])]; diff --git a/addons/inventory/functions/fnc_addCustomFilter.sqf b/addons/inventory/functions/fnc_addCustomFilter.sqf index 6dd6e1f559..50820fa448 100644 --- a/addons/inventory/functions/fnc_addCustomFilter.sqf +++ b/addons/inventory/functions/fnc_addCustomFilter.sqf @@ -12,11 +12,13 @@ * None * * Example: - * ["displayname", "filter"] call ACE_inventory_fnc_addCustomFilter + * ["displayname", "filter"] call ace_inventory_fnc_addCustomFilter * * Public: No */ -params [["_filterName", "ERROR: No Name", [""]], ["_fncName", "", [""]]]; +params [["_filterName", "", [""]], ["_fncName", "", [""]]]; + +if (_filterName == "") exitWith {}; GVAR(customFilters) pushBack [_filterName, _fncName]; diff --git a/addons/inventory/functions/fnc_currentItemListBox.sqf b/addons/inventory/functions/fnc_currentItemListBox.sqf index b3e5ce40b8..1546e8a509 100644 --- a/addons/inventory/functions/fnc_currentItemListBox.sqf +++ b/addons/inventory/functions/fnc_currentItemListBox.sqf @@ -12,7 +12,7 @@ * Currently selected item list box * * Example: - * [DISPLAY] call ACE_inventory_fnc_currentItemListBox + * [DISPLAY] call ace_inventory_fnc_currentItemListBox * * Public: No */ @@ -27,7 +27,6 @@ scopeName "main"; if (ctrlShown _control) then { _control breakOut "main"; }; - false -} count [IDC_ITEMLIST_GROUND, IDC_ITEMLIST_SOLDIER, IDC_ITEMLIST_UNIFORM, IDC_ITEMLIST_VEST, IDC_ITEMLIST_BACKPACK]; +} forEach [IDC_ITEMLIST_GROUND, IDC_ITEMLIST_SOLDIER, IDC_ITEMLIST_UNIFORM, IDC_ITEMLIST_VEST, IDC_ITEMLIST_BACKPACK]; controlNull diff --git a/addons/movement/functions/fnc_inventoryDisplayLoad.sqf b/addons/inventory/functions/fnc_displayNameWeight.sqf similarity index 68% rename from addons/movement/functions/fnc_inventoryDisplayLoad.sqf rename to addons/inventory/functions/fnc_displayNameWeight.sqf index 95299a3b34..c480593d85 100644 --- a/addons/movement/functions/fnc_inventoryDisplayLoad.sqf +++ b/addons/inventory/functions/fnc_displayNameWeight.sqf @@ -10,26 +10,27 @@ * None * * Example: - * [DISPLAY] call ACE_movement_fnc_inventoryDisplayLoad + * [DISPLAY] call ace_inventory_fnc_displayNameWeight * * Public: No */ params ["_display"]; -// forces player name control to display irrespective of isStreamFriendlyUIEnabled +// Forces player name control to display irrespective of isStreamFriendlyUIEnabled (_display displayCtrl 111) ctrlShow true; private _fnc_update = { params ["_display"]; + private _control = _display displayCtrl 111; private _format = ["%1 - %2 %3 (%4)", "%2 %3 (%4)"] select isStreamFriendlyUIEnabled; _control ctrlSetText format [_format, - [ACE_player, false, true] call EFUNC(common,getName), - localize ELSTRING(common,Weight), - [ACE_player] call EFUNC(common,getWeight), - [ACE_player, true] call EFUNC(common,getWeight) + [GVAR(unit), false, true] call EFUNC(common,getName), + LELSTRING(common,Weight), + GVAR(unit) call EFUNC(common,getWeight), + [GVAR(unit), true] call EFUNC(common,getWeight) ]; }; diff --git a/addons/inventory/functions/fnc_filterBackpacks.sqf b/addons/inventory/functions/fnc_filterBackpacks.sqf index 6cb94f3d1c..db1edd9756 100644 --- a/addons/inventory/functions/fnc_filterBackpacks.sqf +++ b/addons/inventory/functions/fnc_filterBackpacks.sqf @@ -10,7 +10,7 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterBackpacks + * [CONFIG] call ace_inventory_fnc_filterBackpacks * * Public: No */ diff --git a/addons/inventory/functions/fnc_filterGrenades.sqf b/addons/inventory/functions/fnc_filterGrenades.sqf index 6d2b813ae4..7e871699b8 100644 --- a/addons/inventory/functions/fnc_filterGrenades.sqf +++ b/addons/inventory/functions/fnc_filterGrenades.sqf @@ -10,11 +10,11 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterGrenades + * [CONFIG] call ace_inventory_fnc_filterGrenades * * Public: No */ params ["_config"]; -toLower configName _config in GVAR(Grenades_ItemList) +(configName _config) in (uiNamespace getVariable QGVAR(grenadesItemList)) diff --git a/addons/inventory/functions/fnc_filterHeadgear.sqf b/addons/inventory/functions/fnc_filterHeadgear.sqf index 134a4fc45f..010c33040f 100644 --- a/addons/inventory/functions/fnc_filterHeadgear.sqf +++ b/addons/inventory/functions/fnc_filterHeadgear.sqf @@ -10,7 +10,7 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterHeadgear + * [CONFIG] call ace_inventory_fnc_filterHeadgear * * Public: No */ diff --git a/addons/inventory/functions/fnc_filterItems.sqf b/addons/inventory/functions/fnc_filterItems.sqf index 0bdb18310f..a3c2567233 100644 --- a/addons/inventory/functions/fnc_filterItems.sqf +++ b/addons/inventory/functions/fnc_filterItems.sqf @@ -10,11 +10,14 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterItems + * [CONFIG] call ace_inventory_fnc_filterItems * * Public: No */ params ["_config"]; -!(getNumber (_config >> "ItemInfo" >> "type") in [TYPE_UNIFORM, TYPE_VESTS, TYPE_HEADGEAR]) && {!(_this call FUNC(filterBackpacks))} +!(_this call FUNC(filterMedical)) && +{!(_this call FUNC(filterBackpacks))} && +{!(_this call FUNC(filterHeadgear))} && +{!(getNumber (_config >> "ItemInfo" >> "type") in [TYPE_UNIFORM, TYPE_VEST])} diff --git a/addons/inventory/functions/fnc_filterMagazines.sqf b/addons/inventory/functions/fnc_filterMagazines.sqf index 4b7747c5a8..e6d9237c21 100644 --- a/addons/inventory/functions/fnc_filterMagazines.sqf +++ b/addons/inventory/functions/fnc_filterMagazines.sqf @@ -10,9 +10,9 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterMagazines + * [CONFIG] call ace_inventory_fnc_filterMagazines * * Public: No */ -!(_this call FUNC(filterBackpacks)) && {!(_this call FUNC(filterGrenades))} +!(_this call FUNC(filterGrenades)) && {!(_this call FUNC(filterBackpacks))} diff --git a/addons/inventory/functions/fnc_filterMedical.sqf b/addons/inventory/functions/fnc_filterMedical.sqf index ec44ba2a76..73cfdbdffb 100644 --- a/addons/inventory/functions/fnc_filterMedical.sqf +++ b/addons/inventory/functions/fnc_filterMedical.sqf @@ -10,11 +10,11 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterMedical + * [CONFIG] call ace_inventory_fnc_filterMedical * * Public: No */ params ["_config"]; -toLower configName _config in GVAR(Medical_ItemList) +(configName _config) in GVAR(medicalItemList) diff --git a/addons/inventory/functions/fnc_filterUniforms.sqf b/addons/inventory/functions/fnc_filterUniforms.sqf index dc7d4e9287..b627475038 100644 --- a/addons/inventory/functions/fnc_filterUniforms.sqf +++ b/addons/inventory/functions/fnc_filterUniforms.sqf @@ -10,7 +10,7 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterUniforms + * [CONFIG] call ace_inventory_fnc_filterUniforms * * Public: No */ diff --git a/addons/inventory/functions/fnc_filterVests.sqf b/addons/inventory/functions/fnc_filterVests.sqf index 439d826390..2bb2af9ef4 100644 --- a/addons/inventory/functions/fnc_filterVests.sqf +++ b/addons/inventory/functions/fnc_filterVests.sqf @@ -10,7 +10,7 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterVests + * [CONFIG] call ace_inventory_fnc_filterVests * * Public: No */ diff --git a/addons/inventory/functions/fnc_filterWeapons.sqf b/addons/inventory/functions/fnc_filterWeapons.sqf index 2addf83665..db4d402099 100644 --- a/addons/inventory/functions/fnc_filterWeapons.sqf +++ b/addons/inventory/functions/fnc_filterWeapons.sqf @@ -10,7 +10,7 @@ * Item should appear in this list? * * Example: - * [CONFIG] call ACE_inventory_fnc_filterWeapons + * [CONFIG] call ace_inventory_fnc_filterWeapons * * Public: No */ diff --git a/addons/inventory/functions/fnc_forceItemListUpdate.sqf b/addons/inventory/functions/fnc_forceItemListUpdate.sqf index a806326677..fb8f09b5c8 100644 --- a/addons/inventory/functions/fnc_forceItemListUpdate.sqf +++ b/addons/inventory/functions/fnc_forceItemListUpdate.sqf @@ -10,23 +10,38 @@ * None * * Example: - * [DISPLAY] call ACE_inventory_fnc_forceitemListUpdate + * [DISPLAY] call ace_inventory_fnc_forceItemListUpdate * * Public: No */ disableSerialization; + params ["_display"]; +// Get the appropriate filter +private _filterFunction = missionNamespace getVariable [(_display displayCtrl IDC_FILTERLISTS) lbData GVAR(selectedFilterIndex), ""]; + +if !(_filterFunction isEqualType {}) exitWith {}; + private _itemList = _display call FUNC(currentItemListBox); -private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData GVAR(selectedFilterIndex)); +private _itemKeyCache = uiNamespace getVariable QGVAR(itemKeyCache); +private _backpackKeyCache = uiNamespace getVariable QGVAR(backpackKeyCache); +private _config = configNull; -if (_filterFunction isEqualType {}) then { - for "_i" from (lbSize _itemList) - 1 to 0 step -1 do { - private _config = GVAR(ItemKeyNamespace) getVariable format ["%1:%2", _itemList lbText _i, _itemList lbPicture _i]; +for "_i" from (lbSize _itemList) to 0 step -1 do { + // All items have their classnames in lbData, except backpacks + _className = _itemList lbData _i; - if (!isNil "_config" && {!(_config call _filterFunction)}) then { - _itemList lbDelete _i; - }; + _config = if (_className != "") then { + _itemKeyCache get _className + } else { + // Backpack are gotten with their display name and inventory icon + _backpackKeyCache get format ["%1:%2", _itemList lbText _i, _itemList lbPicture _i] + }; + + // If item is valid and doesn't match the current filter, remove it + if (!isNil "_config" && {!(_config call _filterFunction)}) then { + _itemList lbDelete _i; }; }; diff --git a/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf index ca9f7a5343..3e70bbd8d9 100644 --- a/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf +++ b/addons/inventory/functions/fnc_inventoryDisplayLoad.sqf @@ -10,40 +10,42 @@ * None * * Example: - * [DISPLAY] call ACE_inventory_fnc_inventoryDisplayLoad + * [DISPLAY] call ace_inventory_fnc_inventoryDisplayLoad * * Public: No */ disableSerialization; + params ["_display"]; private _filter = _display displayCtrl IDC_FILTERLISTS; -// engine defined behaviour is the following: +// Engine defined behaviour is the following: // lb value, data and text don't matter, only the index. -// the first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items -// all of them show backpacks, because BI -// all other indecies show everything, so all we have to do is delete stuff we dont like +// The first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items +// All of them show backpacks, because BI +// All other indecies show everything, so all we have to do is delete stuff we don't like _filter ctrlAddEventHandler ["LBSelChanged", LINKFUNC(onLBSelChanged)]; -// have to add these a frame later, because this event happens before the engine adds the default filters +// Have to add these a frame later, because this event happens before the engine adds the default filters [{ disableSerialization; + params ["_filter"]; - // remove "All", so we can push it to the back later. - // to keep localization we can keep the lbText (displayed name). + // Remove "All", so we can push it to the back later + // To keep localization we keep the lbText (displayed name) private _index = lbSize _filter - 1; private _nameAll = _filter lbText _index; _filter lbDelete _index; - // add additional filter functions to the default filters. These remove backpacks etc. + // Add additional filter functions to the default filters. These remove backpacks etc. _filter lbSetData [0, QFUNC(filterWeapons)]; _filter lbSetData [1, QFUNC(filterMagazines)]; _filter lbSetData [2, QFUNC(filterItems)]; - // add our custom filters + // Add our custom filters { _x params ["_name", "_fncName"]; @@ -51,24 +53,17 @@ _filter ctrlAddEventHandler ["LBSelChanged", LINKFUNC(onLBSelChanged)]; _filter lbSetData [_index, _fncName]; } forEach GVAR(customFilters); - // readd "All" filter to last position and select it + // Readd "All" filter to last position and select it _index = _filter lbAdd _nameAll; _filter lbSetCurSel _index; -}, [_filter]] call CBA_fnc_execNextFrame; +}, _filter] call CBA_fnc_execNextFrame; -// monitor changes that can happen and force our update +// Monitor changes that can happen and force our update private _dummyControl = _display ctrlCreate ["RscMapControl", -1]; -_dummyControl ctrlSetPosition [0,0,0,0]; +_dummyControl ctrlSetPosition [0, 0, 0, 0]; _dummyControl ctrlCommit 0; _dummyControl ctrlAddEventHandler ["Draw", { - disableSerialization; - params ["_dummyControl"]; - - private _display = ctrlParent _dummyControl; - - private _itemList = _display call FUNC(currentItemListBox); - - _display call FUNC(forceItemListUpdate); + (ctrlParent (_this select 0)) call FUNC(forceItemListUpdate); }]; diff --git a/addons/inventory/functions/fnc_onLBSelChanged.sqf b/addons/inventory/functions/fnc_onLBSelChanged.sqf index 6fbc7020c0..a2316dc4b6 100644 --- a/addons/inventory/functions/fnc_onLBSelChanged.sqf +++ b/addons/inventory/functions/fnc_onLBSelChanged.sqf @@ -12,19 +12,16 @@ * None * * Example: - * [CONTROL, 5] call ACE_inventory_fnc_onLBSelChanged + * [CONTROL, 5] call ace_inventory_fnc_onLBSelChanged * * Public: No */ disableSerialization; + params ["_filter", "_index"]; GVAR(selectedFilterIndex) = _index; -[{ - disableSerialization; - params ["_display"]; - - [_display] call FUNC(forceItemListUpdate); -}, [ctrlParent _filter]] call CBA_fnc_execNextFrame; +// Force update +[LINKFUNC(forceItemListUpdate), ctrlParent _filter] call CBA_fnc_execNextFrame; diff --git a/addons/irlight/XEH_postInit.sqf b/addons/irlight/XEH_postInit.sqf index 47763b8414..d95186f07b 100644 --- a/addons/irlight/XEH_postInit.sqf +++ b/addons/irlight/XEH_postInit.sqf @@ -2,7 +2,7 @@ [] call FUNC(initItemContextMenu); -addUserActionEventHandler ["headlights", "Deactivate", FUNC(onLightToggled)]; +addUserActionEventHandler ["headlights", "Deactivate", LINKFUNC(onLightToggled)]; ["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), { ACE_player action ["GunLightOn", ACE_player]; diff --git a/addons/irlight/stringtable.xml b/addons/irlight/stringtable.xml index ac874759a4..ab70abdebd 100644 --- a/addons/irlight/stringtable.xml +++ b/addons/irlight/stringtable.xml @@ -10,6 +10,7 @@ DBAL-A3 (rouge) DBAL-A3 (vermelho) DBAL-A3 (赤) + DBAL-A3 (красный) DBAL-A3 (green) @@ -20,6 +21,7 @@ DBAL-A3 (vert) DBAL-A3 (verde) DBAL-A3 (緑) + DBAL-A3 (зеленый) <t color='#9cf953'>Use: </t>Turn Laser ON/OFF<br>Double click to switch mode @@ -30,6 +32,7 @@ <t color='#9cf953'>Utilisation: </t>Allumer/Eteindre le laser<br>Double clic pour changer de mode <t color='#9cf953'>Uso: </t>Ligar/Desligar Laser<br>Duplo clique para mudar o modo <t color='#9cf953'>使用方法: </t>レーザーのオン/オフ切り替え<br>ダブルクリックでモード切り替え + <t color='#9cf953'>Использование: </t>Включение / выключение лазера <br>Двойной щелчок для переключения режима Dual Beam Aiming Laser @@ -40,6 +43,7 @@ Viseur laser à double faisceau Laser de Pontaria de Duplo Feixe 複合ビーム照準レーザー + Двухлучевой прицельный лазер Visible Laser @@ -50,6 +54,7 @@ Laser visible Laser Visível 可視光レーザー + Видимый лазер IR Laser @@ -60,6 +65,7 @@ Laser IR Laser IR IRレーザー + ИК-лазер IR Illuminator @@ -70,6 +76,7 @@ Illuminateur IR Iluminador IR IRイルミネーター + ИК-осветитель IR Laser and Illuminator @@ -80,6 +87,7 @@ Illuminateur et laser IR Laser e Iluminador IR IRレーザーとイルミネーター + ИК-лазер и осветитель Wide Beam @@ -90,6 +98,7 @@ Faisceau large Feixe Largo 広角ビーム + Широкий луч Medium Beam @@ -100,6 +109,7 @@ Faisceau moyen Feixe Médio 標準ビーム + Средний луч Narrow Beam @@ -110,6 +120,7 @@ Faisceau étroit Feixe Estreito 狭角ビーム + Узкий луч <t color='#9cf953'>Use: </t>Turn Light ON/OFF<br>Double click to switch mode @@ -120,6 +131,7 @@ <t color='#9cf953'>Utilisation: </t>Allumer/Eteindre la lumière<br>Double clic pour changer de mode <t color='#9cf953'>Uso: </t>Ligar/Desligar Iluminador<br>Duplo clique para mudar o modo <t color='#9cf953'>使用方法: </t>ライトのオン/オフ<br>ダブルクリックでモード切り替え + <t color='#9cf953'>Использование: </t>Включение / выключение освещения <br>Двойной щелчок для переключения режима Special Purpose IR LED Illuminator @@ -130,6 +142,7 @@ Illuminateur LED IR à usage spécial Iluminador LED IR de Uso Especial 特殊用途のIR LEDイルミネーター + ИК-светодиодный осветитель специального назначения Illuminator / Laser Momentary Switch @@ -140,6 +153,7 @@ Commutateur temporaire illuminateur/laser Interruptor Momentâneo Iluminador/Laser イルミネーター/レーザーモーメンタリースイッチ + Мгновенный переключатель осветителя/лазера diff --git a/addons/javelin/functions/fnc_mapHelperDraw.sqf b/addons/javelin/functions/fnc_mapHelperDraw.sqf index 2794d46f58..4f7ac84b4a 100644 --- a/addons/javelin/functions/fnc_mapHelperDraw.sqf +++ b/addons/javelin/functions/fnc_mapHelperDraw.sqf @@ -18,7 +18,7 @@ */ if (isNil QGVAR(arguments)) then { - TRACE_1("Starting optic draw", _this); + TRACE_1("Starting optic draw",_this); // reset shooter var: private _currentShooter = if (ACE_player call CBA_fnc_canUseWeapon) then {ACE_player} else {vehicle ACE_player}; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index e6809a8e04..aacc4f5fa1 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -146,13 +146,13 @@ if (isNull _newTarget) then { _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); } else { if ((!isNull _newTarget) && {_currentTarget != _newTarget}) then { - TRACE_1("New Target, reseting locking", _newTarget); + TRACE_1("New Target, reseting locking",_newTarget); _lockStartTime = CBA_missionTime; _currentTarget = _newTarget; }; if ((CBA_missionTime - _lockStartTime) > __LOCKONTIME) then { // Lock on after 3 seconds - TRACE_2("LOCKED!", _currentTarget, _lockStartTime); + TRACE_2("LOCKED!",_currentTarget,_lockStartTime); __JavelinIGUISeek ctrlSetTextColor __ColorGreen; __JavelinIGUITargetingLines ctrlShow true; diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index 14fd6047f2..318a5a7123 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -15,6 +15,8 @@ * Public: No */ +#define TEMPERATURE_SLOT_INDEX 5 + private _playerDir = getDir ACE_player; private _playerAltitude = (getPosASL ACE_player) select 2; private _temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); @@ -41,9 +43,10 @@ if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then { [0, _playerDir] call FUNC(updateMemory); if (GVAR(MinAvgMaxMode) == 1) then { + private _useAB = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]; { GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1]; - } count [2, 3, 4]; + } forEach [2, 3, 4]; // Wind SPD private _windSpeed = call FUNC(measureWindSpeed); @@ -51,7 +54,7 @@ if (GVAR(MinAvgMaxMode) == 1) then { // CROSSWIND private _crosswind = 0; - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + if (_useAB) then { _crosswind = abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed); } else { _crosswind = abs(sin(GVAR(RefHeading)) * _windSpeed); @@ -60,7 +63,7 @@ if (GVAR(MinAvgMaxMode) == 1) then { // HEADWIND private _headwind = 0; - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + if (_useAB) then { _headwind = cos(GVAR(RefHeading) - _playerDir) * _windSpeed; } else { _headwind = cos(GVAR(RefHeading)) * _windSpeed; @@ -74,4 +77,18 @@ if (GVAR(MinAvgMaxMode) == 1) then { GVAR(TOTAL) set [4, (GVAR(TOTAL) select 4) + _headwind]; }; -{ _x call FUNC(updateMemory); true } count [[5, _temperature],[6, _chill],[7, _humidity],[8, _heatIndex],[9, _dewPoint],[10, _wetBulb],[11, _barometricPressure],[12, _altitude],[13, _densityAltitude]]; +private _data = [ + _temperature, + _chill, + _humidity, + _heatIndex, + _dewPoint, + _wetBulb, + _barometricPressure, + _altitude, + _densityAltitude +]; + +{ + [TEMPERATURE_SLOT_INDEX + _forEachIndex, _x] call FUNC(updateMemory); +} forEach _data; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index 2143904f80..59bb3056dd 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -93,7 +93,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { }; case 1: { // Direction if (!GVAR(MinAvgMax)) then { - _textCenterBig = format["%1", format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]]; + _textCenterBig = format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]; } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; diff --git a/addons/killtracker/CfgEventHandlers.hpp b/addons/killtracker/CfgEventHandlers.hpp index 9cc1b0427b..4300a157b9 100644 --- a/addons/killtracker/CfgEventHandlers.hpp +++ b/addons/killtracker/CfgEventHandlers.hpp @@ -1,3 +1,9 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); + }; +}; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index 9cef418ece..c5adc26692 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -136,7 +136,9 @@ GVAR(killCount) = 0; _unitName = format ["*AI* - %1", getText ((configOf _unit) >> "displayName")]; }; }; - TRACE_3("send kill event",_killer,_unitName,_killInfo); - [QGVAR(kill), [_unitName, _killInfo], _killer] call CBA_fnc_targetEvent; + if (_unitIsPlayer || GVAR(trackAI)) then { + TRACE_3("send kill event",_killer,_unitName,_killInfo); + [QGVAR(kill), [_unitName, _killInfo], _killer] call CBA_fnc_targetEvent; + }; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/killtracker/XEH_preInit.sqf b/addons/killtracker/XEH_preInit.sqf new file mode 100644 index 0000000000..7c7b764686 --- /dev/null +++ b/addons/killtracker/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +#include "initSettings.inc.sqf" + +ADDON = true; diff --git a/addons/killtracker/initSettings.inc.sqf b/addons/killtracker/initSettings.inc.sqf new file mode 100644 index 0000000000..ebe1e55ccb --- /dev/null +++ b/addons/killtracker/initSettings.inc.sqf @@ -0,0 +1,8 @@ +[ + QGVAR(trackAI), + "CHECKBOX", + [LSTRING(TrackAI_DisplayName), LSTRING(TrackAI_Description)], + LSTRING(Category), + true, + 1 +] call CBA_fnc_addSetting; diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 4aa7308924..24c7bcdd56 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -1,9 +1,18 @@ + + ACE Kill Tracker + ACE Tracciatore di Uccisioni + ACE Kill Tracker + ACE Отслеживание убийств + ACE キルトラッカー + ACE 킬트래커 + ACE Suivi des morts + ACE Killed Events - ACE キルトラッカー + ACE キルイベント ACE Abgeschossene Ereignisse ACE Eventi di Morte ACE Licznik Zabójstw @@ -86,5 +95,23 @@ 同士討ち Dost Atışı + + Track AI units killed by player + Traccia IA uccise da giocatori + Sledovat AI zabité hráči + Отслеживание юнитов ИИ, убитых игроком + プレイヤーに殺害されたAIユニットを追跡 + 플레이어가 죽인 AI 트래킹 + Suivi de l'IA tuée par les joueurs + + + Defines if killed AIs will be shown in the kill tracker during mission debriefing. + Determina se IA uccise verranno visualizzate nel tracciatore durante il debriefing della missione. + Udává zdali se zabité AI budou ukazovat v kill trackeru v průběhu debriefingu po misi. + Определяет, будут ли убитые ИИ отображаться в трекере убийств во время дебрифинга миссии. + ミッションデブリーフィングのキルトラッカーに殺害されたAIが表示されるかどうかを定義します。 + 사후강평 중 살해된 AI가 킬트래킹에 표시되는지 여부를 정의합니다. + Définit si les IA tuées seront affichées dans le tracker pendant le débriefing de la mission. + diff --git a/addons/laser/XEH_PREP.hpp b/addons/laser/XEH_PREP.hpp index 9b9be64752..2d26ff81f2 100644 --- a/addons/laser/XEH_PREP.hpp +++ b/addons/laser/XEH_PREP.hpp @@ -3,6 +3,7 @@ PREP(addLaserTarget); PREP(addMapHandler); PREP(dev_drawVisibleLaserTargets); PREP(findLaserSource); +PREP(getLaserCode); PREP(handleLaserTargetCreation); PREP(keyLaserCodeChange); PREP(laserOff); @@ -13,6 +14,7 @@ PREP(onLaserDesignatorDraw); PREP(rotateVectLine); PREP(rotateVectLineGetMap); PREP(seekerFindLaserSpot); +PREP(setLaserCode); PREP(shootCone); PREP(shootRay); PREP(showVehicleHud); diff --git a/addons/laser/functions/fnc_addLaserTarget.sqf b/addons/laser/functions/fnc_addLaserTarget.sqf index 08ea6f65b0..3fc02b2189 100644 --- a/addons/laser/functions/fnc_addLaserTarget.sqf +++ b/addons/laser/functions/fnc_addLaserTarget.sqf @@ -55,5 +55,5 @@ TRACE_1("",GVAR(trackedLaserTargets)); if (GVAR(pfehID) == -1) then { TRACE_1("starting pfeh",count GVAR(trackedLaserTargets)); - GVAR(pfehID) = [DFUNC(laserTargetPFH), 0, []] call CBA_fnc_addPerFrameHandler; + GVAR(pfehID) = [LINKFUNC(laserTargetPFH), 0, []] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/laser/functions/fnc_getLaserCode.sqf b/addons/laser/functions/fnc_getLaserCode.sqf new file mode 100644 index 0000000000..0a0fce363f --- /dev/null +++ b/addons/laser/functions/fnc_getLaserCode.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Gets the laser code of a laser source. + * + * Argument: + * 0: Laser source + * + * Return Value: + * Laser code + * + * Example: + * player call ace_laser_fnc_getLaserCode; + * + * Public: Yes + */ + +params [["_laserSource", objNull, [objNull]]]; + +if (isNull _laserSource) exitWith { + -1 +}; + +_laserSource getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE] diff --git a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf index b8cedf22c3..bd42a3e5a5 100644 --- a/addons/laser/functions/fnc_handleLaserTargetCreation.sqf +++ b/addons/laser/functions/fnc_handleLaserTargetCreation.sqf @@ -24,13 +24,13 @@ TRACE_1("params",_this); private _owners = allUnits select {(lasertarget _x) == _targetObject}; if (count _owners == 1) exitWith { - TRACE_2("Laser target owner [allUnits]", _targetObject, _owners select 0); + TRACE_2("Laser target owner [allUnits]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; _owners = vehicles select {(lasertarget _x) == _targetObject}; if (count _owners == 1) exitWith { - TRACE_2("Laser target owner [vehicles]", _targetObject, _owners select 0); + TRACE_2("Laser target owner [vehicles]",_targetObject,_owners select 0); [_targetObject, _owners select 0] call FUNC(addLaserTarget); }; @@ -58,7 +58,7 @@ TRACE_1("params",_this); }; }; if (!_foundSource) then { - WARNING_1("Laser target doesn't have owner", _targetObject); + WARNING_1("Laser target doesn't have owner",_targetObject); }; }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index 5c5f51931b..0b19b4d1c3 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -26,7 +26,7 @@ GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { // Turn off the laser in ace_laser [_laserUuid] call FUNC(laserOff); - TRACE_1("Laser off:", _laserUuid); + TRACE_1("Laser off:",_laserUuid); false } else { private _newCode = _owner getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 9d3e2d6fa1..aa3e43d35a 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -101,9 +101,9 @@ private _finalOwner = objNull; }; } forEach (values GVAR(laserEmitters)); // Go through all values in hash -TRACE_2("",count _spots, _spots); +TRACE_2("",count _spots,_spots); -if ((count _spots) > 0) then { +if (_spots isNotEqualTo []) then { private _bucketList = nil; private _bucketPos = nil; private _c = 0; diff --git a/addons/laser/functions/fnc_setLaserCode.sqf b/addons/laser/functions/fnc_setLaserCode.sqf new file mode 100644 index 0000000000..23f7e5c82f --- /dev/null +++ b/addons/laser/functions/fnc_setLaserCode.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Sets the laser code on a laser source. + * + * Argument: + * 0: Laser source + * 1: Laser code + * + * Return Value: + * None + * + * Example: + * [player, 1111] call ace_laser_fnc_setLaserCode; + * + * Public: Yes + */ + +params [["_laserSource", objNull, [objNull]], ["_laserCode", ACE_DEFAULT_LASER_CODE, [0]]]; + +_laserSource setVariable [QGVAR(code), _laserCode, true]; diff --git a/addons/laser/functions/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf index 434560eea7..862e972dd1 100644 --- a/addons/laser/functions/fnc_shootRay.sqf +++ b/addons/laser/functions/fnc_shootRay.sqf @@ -21,7 +21,7 @@ BEGIN_COUNTER(shootRay); params ["_posASL", "_dir", ["_ignoreVehicle1", objNull], ["_ignoreVehicle2", objNull]]; -// TRACE_2("ray origin:", _posASL, _dir); +// TRACE_2("ray origin:",_posASL,_dir); private _distance = 0; private _resultPos = nil; @@ -43,7 +43,7 @@ if (_intersects isNotEqualTo []) then { _resultPos = _posASL vectorAdd (_dir vectorMultiply _distance); }; -TRACE_3("", _resultPos, _distance, _intersects); +TRACE_3("",_resultPos,_distance,_intersects); #ifdef DRAW_LASER_INFO if (!isNil "_resultPos") then { diff --git a/addons/laser/stringtable.xml b/addons/laser/stringtable.xml index 7c07582725..f0977c84f7 100644 --- a/addons/laser/stringtable.xml +++ b/addons/laser/stringtable.xml @@ -128,6 +128,7 @@ 레이저 스팟 추적기: 켬 Traqueur laser : activé Rastreador a Laser: Ligado + Лазерный точечный трекер: Включен Laser Spot Tracker: Off @@ -138,6 +139,7 @@ 레이저 스팟 추적기: 끔 Traqueur laser : désactivé Rastreador a Laser: Desligado + Лазерный точечный трекер: выключен Draw Laser on Map diff --git a/addons/logistics_wirecutter/XEH_postInit.sqf b/addons/logistics_wirecutter/XEH_postInit.sqf index 29dc506396..fc0a38bf26 100644 --- a/addons/logistics_wirecutter/XEH_postInit.sqf +++ b/addons/logistics_wirecutter/XEH_postInit.sqf @@ -1,11 +1,11 @@ #include "script_component.hpp" if (hasInterface) then { - ["ace_interactMenuOpened", {_this call FUNC(interactEH)}] call CBA_fnc_addEventHandler; + ["ace_interactMenuOpened", LINKFUNC(interactEH)] call CBA_fnc_addEventHandler; }; if (isServer) then { - [QGVAR(destroyFence), {_this call FUNC(destroyFence)}] call CBA_fnc_addEventHandler; + [QGVAR(destroyFence), LINKFUNC(destroyFence)] call CBA_fnc_addEventHandler; }; GVAR(possibleWirecutters) = call (uiNamespace getVariable [QGVAR(possibleWirecutters), {[]}]); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 46e38acb90..2176793aed 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -22,7 +22,10 @@ TRACE_2("Fence cutting started",_unit,_fence); if (_unit != ACE_player) exitWith {}; // Get cut time based on if unit is a engineer -private _cutTime = if (_unit call EFUNC(common,isEngineer)) then {CUT_TIME_ENGINEER} else {CUT_TIME_DEFAULT}; +private _cutTime = [ + CUT_TIME_DEFAULT, + CUT_TIME_ENGINEER +] select (_unit call EFUNC(common,isEngineer)); if !(_unit call EFUNC(common,isSwimming)) then { [_unit, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_destroyFence.sqf b/addons/logistics_wirecutter/functions/fnc_destroyFence.sqf index 3698f4a22f..9a8bde077b 100644 --- a/addons/logistics_wirecutter/functions/fnc_destroyFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_destroyFence.sqf @@ -17,7 +17,7 @@ params ["_fence"]; -private _fenceModel = toLower ((getModelInfo _fence)#0); +private _fenceModel = toLowerANSI ((getModelInfo _fence)#0); // If fence cannot be replaced with destroyed model, just knock it over if !(_fenceModel in GVAR(replacements)) exitWith { diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index ed3a826678..495d592e5f 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -99,7 +99,11 @@ #define TYPE_SCUBA 604 // not implemented #define TYPE_HEADGEAR 605 #define TYPE_FACTOR 607 +#define TYPE_MAP 608 +#define TYPE_COMPASS 609 +#define TYPE_WATCH 610 #define TYPE_RADIO 611 +#define TYPE_GPS 612 #define TYPE_HMD 616 #define TYPE_BINOCULAR 617 #define TYPE_MEDIKIT 619 diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index e233476016..501b3095dc 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 -#define MINOR 16 -#define PATCHLVL 1 -#define BUILD 74 +#define MINOR 17 +#define PATCHLVL 0 +#define BUILD 83 diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 902c0d97c2..b676359f74 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -6,7 +6,7 @@ ACE Logistik ACE Logistyka Logísticas ACE - ACE: логистика + ACE: Логистика ACE Logistika ACE Logística ACE Logistica diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 56b2b560f4..ea3ce19464 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -19,9 +19,9 @@ GVAR(flashlights) = [] call CBA_fnc_createNamespace; setCurrentChannel GVAR(DefaultChannel); if (currentChannel == GVAR(DefaultChannel)) then { - // INFO_1("Channel Set - %1", currentChannel); + // INFO_1("Channel Set - %1",currentChannel); } else { - ERROR_2("Failed To Set Channel %1 (is %2)", GVAR(DefaultChannel), currentChannel); + ERROR_2("Failed To Set Channel %1 (is %2)",GVAR(DefaultChannel),currentChannel); }; }, 0, []] call CBA_fnc_addPerFrameHandler; }; @@ -73,8 +73,7 @@ GVAR(hasWatch) = true; GVAR(hasWatch) = false; { if (_x isKindOf ["ItemWatch", configFile >> "CfgWeapons"]) exitWith {GVAR(hasWatch) = true;}; - false - } count (assignedItems _unit); + } forEach (assignedItems _unit); }, true] call CBA_fnc_addPlayerEventHandler; @@ -93,7 +92,7 @@ GVAR(vehicleLightColor) = [1,1,1,0]; // Handle vehicles with toggleable interior lights: private _vehicleLightCondition = getText (_cfg >> QGVAR(vehicleLightCondition)); if (_vehicleLightCondition == "") then { - private _userAction = toLower getText (_cfg >> "UserActions" >> "ToggleLight" >> "statement"); + private _userAction = toLowerANSI getText (_cfg >> "UserActions" >> "ToggleLight" >> "statement"); if ( false // isClass (_cfg >> "compartmentsLights") || {_userAction find "cabinlights_hide" > 0} diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index f7436e7bf9..af95ce3d6d 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -22,4 +22,4 @@ params ["_logic"]; [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_ShowPlayerNames), "ShowPlayerNames"] call EFUNC(common,readSettingFromModule); -INFO_3("Blue Force Tracking Module Initialized:", GVAR(BFT_Enabled), GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); +INFO_3("Blue Force Tracking Module Initialized:",GVAR(BFT_Enabled),GVAR(BFT_Interval),GVAR(BFT_HideAiGroups)); diff --git a/addons/map/initSettings.inc.sqf b/addons/map/initSettings.inc.sqf index fa248bf736..8de301eaa1 100644 --- a/addons/map/initSettings.inc.sqf +++ b/addons/map/initSettings.inc.sqf @@ -71,7 +71,7 @@ if (GVAR(BFT_Enabled) && {isNil QGVAR(BFT_markers)}) then { GVAR(BFT_markers) = []; - [FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; }; }, false diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 5f11e3601c..5d91167639 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -60,7 +60,7 @@ Nasvícení mapy pomocí baterky Effetto luminoso sul giocatore Lueur lampe carte - 地図をライトで照らす + 地図用ライトの光放射 지도 조명 발광 增加地图亮度 增加地圖亮度 @@ -75,7 +75,7 @@ Añadir resplandor externo a los jugadores que utilizan la linterna en el mapa? Přidat externí záři hráči který používá baterku v mapě? Aggiungi un effetto di luce sul giocatore che sta usando la torcia in mappa, questo è visibile ad altri giocatori. - プレイヤーが地図をフラッシュライトで照らせられるように設定します。 + マップ上で懐中電灯を使用しているプレイヤーから辺りへの光放射を追加しますか? 지도에 조명을 사용하는 플레이어에 외부 불빛을 추가합니까? 当玩家打开手电筒时,增加地图亮度。 當玩家擁有手電筒時,增加地圖亮度? @@ -91,7 +91,7 @@ Térkép-rázkódás Тряска карты Scuotimento della mappa - 地図を揺らす + 地図の揺れ 지도 흔들림 地图震动 地圖震動 @@ -108,7 +108,7 @@ Rázkódjon-e a térkép mozgáskor? Заставлять карту трястись при ходьбе? Far scuotere la mappa mentre cammini? - 歩いているときは地図を揺らすかかどうかを設定できます。 + 歩いているときに地図を揺らしますか? 걸을 때 지도를 보면 흔들리게 합니까? 走路时打开地图会产生晃动。 走路時讓地圖有震動的感覺? @@ -140,7 +140,7 @@ Korlátozva legyen-e a nagyítás mennyisége a térképnél? Ограничить максимальное приближение, доступное на карте? Limita i livelli di zoom disponibili sulla mappa? - 地図上で利用できる拡大倍率を制限できます。 + 地図上で利用できる拡大倍率を制限しますか? 지도 확대에 제한을 둡니까? 限制地图上可允许缩放的倍率? 限制地圖上可允許縮放的倍率? @@ -156,7 +156,7 @@ Kurzor-koordináták mutatása Показывать координаты курсора Mostra coordinate sul cursore - カーソル先で座標を表示 + カーソル先の座標を表示 커서에 좌표를 보이기 显示光标的座标 顯示游標的座標 @@ -172,7 +172,7 @@ Mutatva legyen-e a kurzornál található rész rácskoordinátája? Показывать координаты около курсора мыши? Mostra il numero della coordinata-griglia sul cursore del mouse in mappa? - カーソルで合わせた先を地図座標で表示するかどうかを設定できます。 + カーソルで合わせた先の地図グリッド座標を表示しますか? 지도에서 커서 옆에 좌표가 뜨게 합니까? 显示鼠标光标所在的网格座标? 顯示滑鼠游標所在的網格座標? @@ -268,7 +268,7 @@ Milyen gyakran frissüljenek a jelölők (másodpercben) Как часто должны обновляться маркеры (в секундах) Quanto spesso vengono aggiornati i marker (in secondi) - マーカが再描画される間隔を設定できます (秒) + マーカが再描画される間隔 (秒単位) 몇 초마다 마커를 새로 갱신합니까? 设定每多少时间重新标示出单位位置(秒) 設定每多少時間重新標示出單位位置 (秒) @@ -300,7 +300,7 @@ Jelölők elrejtése "csak AI" csoportoknál? Скрыть маркеры групп, которые состоят полностью из ботов? Nascondi marker per gruppi di sole IA? - 'AIのみ'グループのマーカー表示有無を設定できます。 + 'AIのみ'のグループのマーカー表示有無を設定できます。 인공지능만 있는 그룹의 마커를 숨깁니까? 隐藏'AI 小队'的追踪? 隱藏'AI小隊'的蹤跡? @@ -379,7 +379,7 @@ NVG NVG NVG - 夜間暗視装置 + 暗視装置 야간투시경 夜视仪 夜視鏡 @@ -491,7 +491,7 @@ Imposta Canale all'Avvio Setear canal al comenzar Définir un canal par défaut - 開始時のチャンネルを決定 + 開始時のチャンネルを指定 시작시 채널 设定游戏开始时的聊天频道 設定遊戲開始時的聊天頻道 @@ -506,7 +506,7 @@ Cambia il canale marker iniziale all'avvio della missione Cambiar el canal de marcadores inicial al comenzar la misión Change le canal de communication par défaut au début de la mission. - ミッション開始時にあらかじめ設定されているマーカ チャンネルを変更します + ミッション開始時に使用されるマーカーチャンネルの指定を変更します 미션 시작시 마커채널을 변경합니다 更改任务启动时的聊天频道 更改任務啟動時的聊天頻道 diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index a17bb842d6..91f07c7cdf 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -75,7 +75,7 @@ Maximale Reichweite zwischen Spielern um Kartenzeichen anzuzeigen Máxima distancia a la cual pueden verse el indicador de gestos Définit le rayon au-delà duquel un joueur ne verra plus l'indicateur de pointage des autres joueurs. - プレイヤーによるマップ ジェスチャーの表示範囲を設定します + マップ ジェスチャーのインジケーターを表示可能なプレーヤー間の最大距離 플레이어간에 지도 신호 표시거리를 설정합니다. 设定地图指示显示的最大范围距离 設定地圖指示器顯示的最大範圍距離 @@ -122,7 +122,7 @@ Farbe der Namenstexte. Color de los nombres Couleur du texte du nom - 名前への色 + 名前の文字色 글 색상 명칭 名称文字颜色 名稱文字顏色 @@ -137,7 +137,7 @@ Farbe der Namenstexte neben der Kartenzeichen-Markierung. Color de los nombres dibujados al lado del marcados de gestos. Définit la couleur du texte pour le nom à côté du marqueur de pointage sur carte. - マップ ジェスチャーに表示される、名前の色を決定します。 + マップ ジェスチャーに添えて表示される名前の文字色。 지도 색상에 표시되는 이름의 색상을 결정합니다. 定义名称文字颜色。使其与地图指示颜色有所区别。 定義名稱文字顏色。使其與地圖指示器顏色有所區別 @@ -153,7 +153,7 @@ Gruppenführer-Standardfarbe Color por defecto para el lider Couleur de commandement par défaut - リーダー用標準の色 + 部隊長用の標準色 리더 기본 색상 队长预设颜色 隊長預設顏色 @@ -167,7 +167,7 @@ Ersatz-Farbwert für Gruppenführer wenn keine Gruppeneinstellung vorhanden ist. [Modul: leer lassen um Anwendung bei Clients nicht zu erzwingen] Color por defecto para líderes cuando no está configurado [Módulo: dejar en blanco para no forzar] Définit la couleur par défaut pour les chefs de groupe quand il n'y a pas de réglage de groupe. [Module : laisser vide pour ne pas forcer chez les clients.] - グループ設定が存在しない場合に、グループ リーダーへ設定される色の値を設定します。[モジュール:空の場合はクライアントへ強制しません] + グループ設定がない場合に部隊長へ設定される色の値を設定します。[モジュール:空の場合はクライアントへ強制しません] 그룹 설정이 없는 경우 리더의 예비 색상 값입니다. [모듈: 클라이언트에서 강체하지 않기 위해 공백으로 비워둘 것] 当没有设定小队颜色时,此功能会定义队长的指示颜色。[模块:此栏留空来保持预设颜色] 當沒有設定小隊顏色時,此功能會定義隊長的指示器顏色。[模塊: 此欄留空來保持預設顏色] @@ -198,7 +198,7 @@ Ersatz-Farbwert wenn keine Gruppeneinstellung vorhanden ist. [Modul: leer lassen um Anwendung bei Clients nicht zu erzwingen] Color por defecto cuando no está configurado [Módulo: dejar en blanco para no forzar] Définit la couleur par défaut quand il n'y a pas de réglage pour le groupe. [Module : laisser vide pour ne pas forcer chez les clients.] - グループ設定が存在しない場合に、グループ リーダーへ設定される色の値を設定します。[モジュール:空の場合はクライアントへ強制しません] + グループ設定がない場合に設定される色の値を設定します。[モジュール:空の場合はクライアントへ強制しません] 그룹 설정이 없을 경우의 예비 색상입니다. [모듈: 클라이언트에서 강체하지 않기 위해 공백으로 비워둘 것] 当没有设定小队颜色时,此功能会定义玩家的指示颜色。[模块:此栏留空来保持预设颜色] 當沒有設定小隊顏色時,此功能會定義玩家的指示器顏色。[模塊: 此欄留空來保持預設顏色] @@ -214,7 +214,7 @@ Gruppenführer-Farbe Color para el líder Couleur de commandement - リーダー用の色 + 部隊長用の色 리더 색상 队长颜色 隊長顏色 @@ -228,7 +228,7 @@ Farbwert für Gruppenführer, die mit diesem Modul synchronisiert werden. Color para los líderes de los grupos sincronizados al módulo. Couleur pour les chefs des groupes synchronisés avec ce module. - モジュールで同期されたグループのリーダー用に色の値を決定します。 + モジュールで同期されたグループの隊長に設定される色の値。 그룹이 이 모듈에 동기화 됐을 때의 리더 색상입니다. 改变与此同步小队队长的指示颜色。 改變與此同步小隊隊長的指示器顏色 @@ -259,7 +259,7 @@ Farbwert für Gruppenmitglieder, die mit diesem Modul synchronisiert werden. Color para los miembros de los grupos sincronizados al módulo. Couleur pour les membres des groupes synchronisés avec ce module. - モジュールで同期されたグループのメンバ用に色の値を決定します。 + モジュールで同期されたグループの隊員に設定される色の値。 그룹이 이 모듈에 동기화 됐을 때의 멤버 색상입니다. 改变与此同步小队队员的指示颜色 改變與此同步小隊隊員的指示器顏色 @@ -270,7 +270,7 @@ Показывать только союзные жесты Pokazuj jedynie sojusznicze gesty Afficher uniquement le pointage des alliés - 友軍ジェスチャーのみ表示 + 友軍のジェスチャーのみ表示 Mostrar sólo gestos de aliados Nur Gesten befreundeter Einheiten zeigen Mostra solo gesti di alleati @@ -283,7 +283,7 @@ Показывать жесты только от игроков союзной стороны. Affiche uniquement les pointages effectués par des unités qui sont du même camp, ou d'un camp allié. Mostra solo gesti effettuati da unità che sono della stessa fazione o una fazione alleata. - 友軍ユニットのみからジェスチャーを表示します。 + 同じ陣営または味方陣営のユニットからのジェスチャーのみを表示します。 Muestra únicamente gestos de las unidades que son del mismo bando o de un bando aliado Pokazuj tylko Gesty od jednostek z tej samej lub sojuszniczej strony Nur Gesten von Einheiten der selben oder einer verbündeten Seite zeigen. @@ -295,7 +295,7 @@ Max range Camera Макс. дальность действия камеры Portée de la caméra - カメラ最大範囲 + カメラの最大範囲 Máximo alcance de cámara Maksymalny zasięg kamery Maximale Kamerareichweite @@ -308,7 +308,7 @@ Max range between a Camera and players to show the map gesture indicator Устанавливает макс. дальность между игроком и камерой для отображения жестов на карте Définit le rayon au-delà duquel une caméra ne verra plus l'indicateur de pointage des autres joueurs. - プレイヤーが行うマップ ジェスチャーをカメラから確認できる最大範囲を設定します。 + 観戦カメラから確認可能なマップ ジェスチャーのインジケーターを表示するカメラとプレーヤー間の最大距離 Máxima distancia entre una cámara y los jugadores para mostrar el indicador de gestos en mapa Distanza massima da cui videocamere (spettatore/zeus) può vedere i gesti di giocatori. Maksymalny zasięg pomiędzy kamerą a graczami do pokazania gestów na mapie @@ -386,7 +386,7 @@ What player can see what Определяет, какая группа игроков может видеть жесты на карте во время брифинга Définit quels pointages les joueurs peuvent voir lors du briefing. - プレイヤーが見ることができる対象を決定します。 + プレイヤーが見ることができる対象 Qué puede ver cada jugador Quali giocatori possono vedere gesti sulla mappa in fase di briefing. Co mogą widzieć gracze diff --git a/addons/maptools/CfgEventHandlers.hpp b/addons/maptools/CfgEventHandlers.hpp index db25394390..bff1c64e94 100644 --- a/addons/maptools/CfgEventHandlers.hpp +++ b/addons/maptools/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp index 8c320de321..0757aafc51 100644 --- a/addons/maptools/CfgVehicles.hpp +++ b/addons/maptools/CfgVehicles.hpp @@ -1,62 +1,204 @@ +#define EXCEPTIONS exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"} + class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { class ACE_MapGpsShow { displayName = CSTRING(MapGpsShow); - condition = QUOTE((!GVAR(mapGpsShow)) && {call FUNC(canUseMapGPS)}); - statement = QUOTE(GVAR(mapGpsShow) = true;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + condition = QUOTE(!GVAR(mapGpsShow) && {call FUNC(canUseMapGPS)}); + statement = QUOTE(GVAR(mapGpsShow) = true); + EXCEPTIONS; showDisabled = 0; }; class ACE_MapGpsHide { displayName = CSTRING(MapGpsHide); - condition = QUOTE((GVAR(mapGpsShow)) && {call FUNC(canUseMapGPS)}); - statement = QUOTE(GVAR(mapGpsShow) = false;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + condition = QUOTE(GVAR(mapGpsShow) && {call FUNC(canUseMapGPS)}); + statement = QUOTE(GVAR(mapGpsShow) = false); + EXCEPTIONS; showDisabled = 0; }; class ACE_MapTools { displayName = CSTRING(MapTools_Menu); condition = QUOTE(call FUNC(canUseMapTools)); statement = ""; - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + EXCEPTIONS; showDisabled = 0; + class ACE_MapToolsHide { displayName = CSTRING(MapToolsHide); condition = QUOTE(GVAR(mapTool_Shown) != 0); - statement = QUOTE(GVAR(mapTool_Shown) = 0;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + statement = QUOTE(GVAR(mapTool_Shown) = 0); + EXCEPTIONS; showDisabled = 1; }; class ACE_MapToolsShowNormal { displayName = CSTRING(MapToolsShowNormal); condition = QUOTE(GVAR(mapTool_Shown) != 1); - statement = QUOTE(if (GVAR(mapTool_Shown) == 0) then {GVAR(mapTool_moveToMouse) = true}; GVAR(mapTool_Shown) = 1;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + statement = QUOTE(if (GVAR(mapTool_Shown) == 0) then {GVAR(mapTool_moveToMouse) = true}; GVAR(mapTool_Shown) = 1); + EXCEPTIONS; showDisabled = 1; }; class ACE_MapToolsShowSmall { displayName = CSTRING(MapToolsShowSmall); condition = QUOTE(GVAR(mapTool_Shown) != 2); - statement = QUOTE(if (GVAR(mapTool_Shown) == 0) then {GVAR(mapTool_moveToMouse) = true}; GVAR(mapTool_Shown) = 2;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + statement = QUOTE(if (GVAR(mapTool_Shown) == 0) then {GVAR(mapTool_moveToMouse) = true}; GVAR(mapTool_Shown) = 2); + EXCEPTIONS; showDisabled = 1; }; - class ACE_MapToolsAlignNorth { - displayName = CSTRING(MapToolsAlignNorth); + class ACE_MapToolsAlign { + displayName = CSTRING(AlignTo); condition = QUOTE(GVAR(mapTool_Shown) != 0); - statement = QUOTE(GVAR(mapTool_angle) = 0;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + statement = ""; + EXCEPTIONS; + showDisabled = 0; + + class ACE_MapToolsAlignToPlottingBoardRuler { + displayName = CSTRING(ToPlottingBoardRulerLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && GVAR(plottingBoard_Shown) == 2); + statement = QUOTE(GVAR(mapTool_angle) = GVAR(plottingBoard_rulerAngle)); + EXCEPTIONS; + showDisabled = 1; + }; + class ACE_MapToolsAlignToPlottingBoardAcrylic { + displayName = CSTRING(ToPlottingBoardAcrylicLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && GVAR(plottingBoard_Shown) != 0); + statement = QUOTE(GVAR(mapTool_angle) = GVAR(plottingBoard_acrylicAngle)); + EXCEPTIONS; + showDisabled = 1; + }; + class ACE_MapToolsAlignToPlottingBoard { + displayName = CSTRING(ToPlottingBoardLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && GVAR(plottingBoard_Shown) != 0); + statement = QUOTE(GVAR(mapTool_angle) = GVAR(plottingBoard_angle)); + EXCEPTIONS; + showDisabled = 1; + }; + class ACE_MapToolsAlignCompass { + displayName = CSTRING(ToCompassLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && {ACE_player getSlotItemName TYPE_COMPASS != ''}); + statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player); + EXCEPTIONS; + showDisabled = 1; + }; + class ACE_MapToolsAlignNorth { + displayName = CSTRING(ToNorthLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0); + statement = QUOTE(GVAR(mapTool_angle) = 0); + EXCEPTIONS; + showDisabled = 1; + }; + }; + }; + class ACE_PlottingBoard { + displayName = CSTRING(ShowPlottingBoard); + condition = QUOTE(GVAR(plottingBoard_Shown) == 0 && {call FUNC(canUsePlottingBoard)}); + statement = QUOTE(GVAR(plottingBoard_Shown) = 1); + EXCEPTIONS; + showDisabled = 0; + }; + class ACE_PlottingBoardHide { + displayName = CSTRING(HidePlottingBoard); + condition = QUOTE(GVAR(plottingBoard_Shown) != 0 && {call FUNC(canUsePlottingBoard)}); + statement = QUOTE(GVAR(plottingBoard_Shown) = 0); + EXCEPTIONS; + showDisabled = 0; + + class ACE_PlottingBoardRulerShow { + displayName = CSTRING(TogglePlottingBoardRuler); + condition = QUOTE(GVAR(plottingBoard_Shown) == 1); + statement = QUOTE(GVAR(plottingBoard_Shown) = 2); + EXCEPTIONS; showDisabled = 1; }; - class ACE_MapToolsAlignCompass { - displayName = CSTRING(MapToolsAlignCompass); - condition = QUOTE(GVAR(mapTool_Shown) != 0 && {getUnitLoadout ACE_player param [ARR_2(9,[])] param [ARR_2(3,'')] != ''}); - statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player;); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + class ACE_PlottingBoardRulerHide { + displayName = CSTRING(TogglePlottingBoardRuler); + condition = QUOTE(GVAR(plottingBoard_Shown) == 2); + statement = QUOTE(GVAR(plottingBoard_Shown) = 1); + EXCEPTIONS; showDisabled = 1; }; + class ACE_PlottingBoardWipe { + displayName = CSTRING(WipeBoard); + condition = QUOTE(GVAR(plottingBoard_markers) isNotEqualTo createHashMap); + statement = QUOTE(call FUNC(wipeMarkers)); + EXCEPTIONS; + showDisabled = 1; + }; + class ACE_PlottingBoardAlign { + displayName = CSTRING(AlignTo); + condition = QUOTE(GVAR(plottingBoard_Shown) != 0); + statement = ""; + EXCEPTIONS; + showDisabled = 0; + + class ACE_PlottingBoardAlignBoard { + displayName = CSTRING(PlottingBoardLabel); + condition = QUOTE(true); + statement = ""; + EXCEPTIONS; + showDisabled = 0; + + class ACE_PlottingBoardAlignBoardMaptool { + displayName = CSTRING(ToMapToolLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && GVAR(plottingBoard_angle) != GVAR(mapTool_angle)); + statement = QUOTE(GVAR(plottingBoard_angle) = GVAR(mapTool_angle)); + EXCEPTIONS; + showDisabled = 0; + }; + class ACE_PlottingBoardAlignBoardUp { + displayName = CSTRING(ToUpLabel); + condition = QUOTE(GVAR(plottingBoard_angle) != 0); + statement = QUOTE(GVAR(plottingBoard_angle) = 0); + EXCEPTIONS; + showDisabled = 0; + }; + }; + class ACE_PlottingBoardAlignAcrylic { + displayName = CSTRING(PlottingBoardAcrylicLabel); + condition = QUOTE(true); + statement = ""; + EXCEPTIONS; + showDisabled = 0; + + class ACE_PlottingBoardAlignAcrylicMaptool { + displayName = CSTRING(ToMapToolLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && GVAR(plottingBoard_acrylicAngle) != GVAR(mapTool_angle)); + statement = QUOTE(GVAR(plottingBoard_acrylicAngle) = GVAR(mapTool_angle)); + EXCEPTIONS; + showDisabled = 0; + }; + class ACE_PlottingBoardAlignAcrylicUp { + displayName = CSTRING(ToUpLabel); + condition = QUOTE(GVAR(plottingBoard_acrylicAngle) != 0); + statement = QUOTE(GVAR(plottingBoard_acrylicAngle) = 0); + EXCEPTIONS; + showDisabled = 0; + }; + }; + class ACE_PlottingBoardAlignRuler { + displayName = CSTRING(PlottingBoardRulerLabel); + condition = QUOTE(GVAR(plottingBoard_Shown) == 2); + statement = ""; + EXCEPTIONS; + showDisabled = 0; + + class ACE_PlottingBoardAlignRulerMaptool { + displayName = CSTRING(ToMapToolLabel); + condition = QUOTE(GVAR(mapTool_Shown) != 0 && GVAR(plottingBoard_rulerAngle) != GVAR(mapTool_angle)); + statement = QUOTE(GVAR(plottingBoard_rulerAngle) = GVAR(mapTool_angle)); + EXCEPTIONS; + showDisabled = 0; + }; + class ACE_PlottingBoardAlignRulerUp { + displayName = CSTRING(ToUpLabel); + condition = QUOTE(GVAR(plottingBoard_rulerAngle) != 0); + statement = QUOTE(GVAR(plottingBoard_rulerAngle) = 0); + EXCEPTIONS; + showDisabled = 0; + }; + }; + }; }; }; }; @@ -69,30 +211,35 @@ class CfgVehicles { class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_MapTools,12); + MACRO_ADDITEM(ACE_PlottingBoard,12); }; }; class Box_East_Support_F: EAST_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_MapTools,12); + MACRO_ADDITEM(ACE_PlottingBoard,12); }; }; class Box_IND_Support_F: IND_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_MapTools,12); + MACRO_ADDITEM(ACE_PlottingBoard,12); }; }; class Box_FIA_Support_F: FIA_Box_Base_F { class TransportItems { MACRO_ADDITEM(ACE_MapTools,12); + MACRO_ADDITEM(ACE_PlottingBoard,12); }; }; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_MapTools,12); + MACRO_ADDITEM(ACE_PlottingBoard,12); }; }; }; diff --git a/addons/maptools/CfgWeapons.hpp b/addons/maptools/CfgWeapons.hpp index 62d969badb..ca4d4a473e 100644 --- a/addons/maptools/CfgWeapons.hpp +++ b/addons/maptools/CfgWeapons.hpp @@ -14,4 +14,17 @@ class CfgWeapons { mass = 0.2; }; }; + + class ACE_PlottingBoard: ACE_ItemCore { + displayName = CSTRING(PlottingBoard_Name); + author = ECSTRING(common,ACETeam); + descriptionShort = CSTRING(PlottingBoard_Description); + model = QPATHTOF(data\ace_MapTools.p3d); + picture = QPATHTOF(UI\plottingboard_item.paa); + scope = 2; + ACE_isTool = 1; + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 0.5; + }; + }; }; diff --git a/addons/maptools/README.md b/addons/maptools/README.md index a11f57a1a5..fe9c836c13 100644 --- a/addons/maptools/README.md +++ b/addons/maptools/README.md @@ -5,3 +5,4 @@ Adds the following map tools: - Roamer - Map drawing - Showing GPS on map +- Plotting Board diff --git a/addons/maptools/UI/plottingboard_item.paa b/addons/maptools/UI/plottingboard_item.paa new file mode 100644 index 0000000000..2d89f35514 Binary files /dev/null and b/addons/maptools/UI/plottingboard_item.paa differ diff --git a/addons/maptools/XEH_PREP.hpp b/addons/maptools/XEH_PREP.hpp index cf193698e5..ac9ed8b91f 100644 --- a/addons/maptools/XEH_PREP.hpp +++ b/addons/maptools/XEH_PREP.hpp @@ -7,3 +7,8 @@ PREP(handleMouseMove); PREP(isInsideMapTool); PREP(openMapGpsUpdate); PREP(updateMapToolMarkers); + +PREP(canUsePlottingBoard); +PREP(isInsidePlottingBoard); +PREP(handlePlottingBoardMarkers); +PREP(wipeMarkers); diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index eede4db015..5ce1e68892 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -1,4 +1,4 @@ -// by esteldunedain +// by esteldunedain, LorenLuke #include "script_component.hpp" @@ -9,19 +9,32 @@ GVAR(mapGpsShow) = true; GVAR(mapGpsNextUpdate) = -1; GVAR(mapTool_Shown) = 0; -GVAR(mapTool_pos) = [0,0]; +GVAR(mapTool_pos) = [0, 0]; GVAR(mapTool_angle) = 0; GVAR(mapTool_isDragging) = false; GVAR(mapTool_isRotating) = false; GVAR(mapTool_moveToMouse) = true; // used to display it in center of screen when opened -//Install the event handers for the map tools on the main in-game map -[{!isNull findDisplay 12}, -{ - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {call FUNC(updateMapToolMarkers); call FUNC(openMapGpsUpdate);}]; +GVAR(plottingBoard_Shown) = 0; +GVAR(plottingBoard_pos) = [0, 0]; +GVAR(plottingBoard_angle) = 0; +GVAR(plottingBoard_acrylicAngle) = 0; +GVAR(plottingBoard_rulerAngle) = 0; +GVAR(plottingBoard_isDragging) = false; +GVAR(plottingBoard_isRotating) = -1; +GVAR(plottingBoard_moveToMouse) = true; // used to display it in center of screen when opened +GVAR(plottingBoard_markers) = createHashMap; + +// Install the event handers for the map tools on the main in-game map +[{ + !isNull findDisplay 12 +}, { + private _map = (findDisplay 12) displayCtrl 51; + + _map ctrlAddEventHandler ["MouseMoving", LINKFUNC(handleMouseMove)]; + _map ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + _map ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + _map ctrlAddEventHandler ["Draw", {call FUNC(updateMapToolMarkers); call FUNC(openMapGpsUpdate);}]; }, []] call CBA_fnc_waitUntilAndExecute; ["visibleMap", { @@ -32,7 +45,13 @@ GVAR(mapTool_moveToMouse) = true; // used to display it in center of screen whe }; }] call CBA_fnc_addPlayerEventHandler; +addMissionEventHandler ["MarkerCreated", { + [_this, false] call FUNC(handlePlottingBoardMarkers); +}]; + +addMissionEventHandler ["MarkerDeleted", { + [[_this select 0, -1, objNull, _this select 1], true] call FUNC(handlePlottingBoardMarkers); +}]; GVAR(freeDrawingData) = []; GVAR(freedrawing) = false; - diff --git a/addons/maptools/data/plottingBoardAcrylic.paa b/addons/maptools/data/plottingBoardAcrylic.paa new file mode 100644 index 0000000000..eaa8bf2e13 Binary files /dev/null and b/addons/maptools/data/plottingBoardAcrylic.paa differ diff --git a/addons/maptools/data/plottingBoardBack.paa b/addons/maptools/data/plottingBoardBack.paa new file mode 100644 index 0000000000..79772e7cb0 Binary files /dev/null and b/addons/maptools/data/plottingBoardBack.paa differ diff --git a/addons/maptools/data/plottingBoardRuler.paa b/addons/maptools/data/plottingBoardRuler.paa new file mode 100644 index 0000000000..83160af799 Binary files /dev/null and b/addons/maptools/data/plottingBoardRuler.paa differ diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 667ee5ff5d..7c868d200a 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -1,21 +1,22 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Returns the equivalent of 100m in screen coordinates + * Returns the equivalent of 100m in screen coordinates. * * Arguments: * None * * Return Value: - * None + * Map scale * * Example: - * call ACE_maptools_fnc_calculateMapScale + * call ace_maptools_fnc_calculateMapScale * * Public: No */ -private _pos = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; -private _screenOffset = ((findDisplay 12) displayCtrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; +private _mapCtrl = (findDisplay 12) displayCtrl 51; +private _pos = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; +private _screenOffset = _mapCtrl posWorldToScreen (_pos vectorAdd [100, 0]); (_screenOffset select 0) - 0.5 diff --git a/addons/maptools/functions/fnc_canUseMapGPS.sqf b/addons/maptools/functions/fnc_canUseMapGPS.sqf index 1d28af74f6..0bdd0d0ea6 100644 --- a/addons/maptools/functions/fnc_canUseMapGPS.sqf +++ b/addons/maptools/functions/fnc_canUseMapGPS.sqf @@ -1,20 +1,24 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * canUseMapGPS + * Returns if the GPS on the map can be used. * * Arguments: * None * * Return Value: - * Boolean + * GPS can be used * * Example: - * call ACE_maptools_fnc_canUseMapGPS + * call ace_maptools_fnc_canUseMapGPS * * Public: No */ -visibleMap && -{alive ACE_player} && -{"ItemGPS" in (assignedItems ACE_player)} +if (!visibleMap || {!alive ACE_player}) exitWith {false}; + +private _gpsOpened = visibleGPS; +private _gpsAvailable = openGPS true; +if (!_gpsOpened) then {openGPS false}; + +_gpsAvailable // return diff --git a/addons/maptools/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf index ef45c9a527..8eb918dfdc 100644 --- a/addons/maptools/functions/fnc_canUseMapTools.sqf +++ b/addons/maptools/functions/fnc_canUseMapTools.sqf @@ -1,23 +1,23 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * canUseMapTools + * Returns if the map tools can be used. * * Arguments: * None * * Return Value: - * Boolean + * Map tools can be used * * Example: - * call ACE_maptools_fnc_canUseMapTools + * call ace_maptools_fnc_canUseMapTools * * Public: No */ visibleMap && {alive ACE_player} && -{"ACE_MapTools" in (ACE_player call EFUNC(common,uniqueItems))} && {!GVAR(mapTool_isDragging)} && {!GVAR(mapTool_isRotating)} && -{getUnitLoadout ACE_player param [9, []] param [0, ""] != ""} +{ACE_player getSlotItemName TYPE_MAP != ""} && +{[ACE_player, "ACE_MapTools"] call EFUNC(common,hasItem)} diff --git a/addons/maptools/functions/fnc_canUsePlottingBoard.sqf b/addons/maptools/functions/fnc_canUsePlottingBoard.sqf new file mode 100644 index 0000000000..9dfd2bf6b5 --- /dev/null +++ b/addons/maptools/functions/fnc_canUsePlottingBoard.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Returns if the plotting board can be used. + * + * Arguments: + * None + * + * Return Value: + * Plotting board can be used + * + * Example: + * call ace_maptools_fnc_canUsePlottingBoard + * + * Public: No + */ + +visibleMap && +{alive ACE_player} && +{!GVAR(plottingBoard_isDragging)} && +{GVAR(plottingBoard_isRotating) == -1} && +{[ACE_player, "ACE_PlottingBoard"] call EFUNC(common,hasItem)} diff --git a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf index 722f96468e..782d8762a0 100644 --- a/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf +++ b/addons/maptools/functions/fnc_drawLinesOnRoamer.sqf @@ -4,63 +4,71 @@ * Prevents the cursor from entering the roamer when drawing lines and records the positions * * Arguments: - * 0: The Map + * 0: Map control * 1: Roamer Width * * Return Value: * None * * Example: - * [map, 300] call ace_maptools_fnc_drawLinesOnRoamer + * [CONTROL, 300] call ace_maptools_fnc_drawLinesOnRoamer * * Public: No */ if (!GVAR(drawStraightLines)) exitWith {}; -params ["_theMap", "_roamerWidth"]; +params ["_mapCtrl", "_roamerWidth"]; GVAR(mapTool_pos) params ["_roamerPosX", "_roamerPosY"]; private _posCenter = [_roamerPosX, _roamerPosY, 0]; private _posTopRight = [ -_roamerPosX + (cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, -_roamerPosY + (-sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, -0]; + _roamerPosX + (cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, + _roamerPosY + (-sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, + 0 +]; private _posTopLeft = [ -_roamerPosX + (-cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, -_roamerPosY + (sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, -0]; + _roamerPosX + (-cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, + _roamerPosY + (sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_TOP_TO_CENTER_PERC * _roamerWidth, + 0 +]; private _posBottomLeft = [ -_roamerPosX + (-cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, -_roamerPosY + (sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, -0]; + _roamerPosX + (-cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, + _roamerPosY + (sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, + 0 +]; private _posBottomRight = [ -_roamerPosX + (cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, -_roamerPosY + (-sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, -0]; + _roamerPosX + (cos GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (sin GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, + _roamerPosY + (-sin GVAR(mapTool_angle)) * DIST_LEFT_TO_CENTER_PERC * _roamerWidth + (cos GVAR(mapTool_angle)) * DIST_BOTTOM_TO_CENTER_PERC * _roamerWidth, + 0 +]; -private _fnc_Distance = { // Get distance point _p is from a line made from _a to _b (uses 3d array commands, but z should be 0) +private _fnc_distance = { // Get distance point _p is from a line made from _a to _b (uses 3d array commands, but z should be 0) // Ref: https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Vector_formulation params ["_a", "_b", "_p"]; + private _n = _b vectorDiff _a; private _pa = _a vectorDiff _p; private _c = _n vectorMultiply ((_pa vectorDotProduct _n) / (_n vectorDotProduct _n)); private _d = _pa vectorDiff _c; - sqrt (_d vectorDotProduct _d); + + sqrt (_d vectorDotProduct _d) }; -private _currentMousePos = _theMap ctrlMapScreenToWorld getMousePosition; +private _currentMousePos = _mapCtrl ctrlMapScreenToWorld getMousePosition; _currentMousePos set [2, 0]; // Break the roamer rectangle into 4 triangle, one for each side switch (true) do { case (_currentMousePos inPolygon [_posCenter, _posTopLeft, _posBottomLeft]): { // Left - private _distanceToRoamerLine = ([_posTopLeft, _posBottomLeft, _currentMousePos] call _fnc_Distance); - _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, (GVAR(mapTool_angle) - 90) ,0] call CBA_fnc_polar2vect); + private _distanceToRoamerLine = [_posTopLeft, _posBottomLeft, _currentMousePos] call _fnc_distance; + + _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, GVAR(mapTool_angle) - 90, 0] call CBA_fnc_polar2vect); + if (GVAR(freeDrawingData) isEqualTo []) then { // We start drawing on the line GVAR(freeDrawingData) = ["left", _currentMousePos, _currentMousePos]; } else { @@ -68,17 +76,21 @@ switch (true) do { if ((_currentMousePos distance2d _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posTopLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; + if ((_currentMousePos distance2d _posBottomLeft) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomLeft)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; }; - private _screenPosOfCorrectedPos = _theMap ctrlMapWorldToScreen _currentMousePos; + + private _screenPosOfCorrectedPos = _mapCtrl ctrlMapWorldToScreen _currentMousePos; setMousePosition _screenPosOfCorrectedPos; }; case (_currentMousePos inPolygon [_posCenter, _posTopLeft, _posTopRight]): { // Top - private _distanceToRoamerLine = ([_posTopLeft, _posTopRight, _currentMousePos] call _fnc_Distance); - _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, (GVAR(mapTool_angle) + 0) ,0] call CBA_fnc_polar2vect); + private _distanceToRoamerLine = [_posTopLeft, _posTopRight, _currentMousePos] call _fnc_distance; + + _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, GVAR(mapTool_angle), 0] call CBA_fnc_polar2vect); + if (GVAR(freeDrawingData) isEqualTo []) then { // We start drawing on the line GVAR(freeDrawingData) = ["top", _currentMousePos, _currentMousePos]; } else { @@ -86,17 +98,21 @@ switch (true) do { if ((_currentMousePos distance2d _posTopLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posTopLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; + if ((_currentMousePos distance2d _posTopRight) < ((GVAR(freeDrawingData) select 2) distance2d _posTopRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; }; - private _screenPosOfCorrectedPos = _theMap ctrlMapWorldToScreen _currentMousePos; + + private _screenPosOfCorrectedPos = _mapCtrl ctrlMapWorldToScreen _currentMousePos; setMousePosition _screenPosOfCorrectedPos; }; case (_currentMousePos inPolygon [_posCenter, _posTopRight, _posBottomRight]): { // Right - private _distanceToRoamerLine = ([_posTopRight, _posBottomRight, _currentMousePos] call _fnc_Distance); - _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, (GVAR(mapTool_angle) + 90) ,0] call CBA_fnc_polar2vect); + private _distanceToRoamerLine = [_posTopRight, _posBottomRight, _currentMousePos] call _fnc_distance; + + _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, GVAR(mapTool_angle) + 90, 0] call CBA_fnc_polar2vect); + if (GVAR(freeDrawingData) isEqualTo []) then { // We start drawing on the line GVAR(freeDrawingData) = ["right", _currentMousePos, _currentMousePos]; } else { @@ -104,17 +120,21 @@ switch (true) do { if ((_currentMousePos distance2d _posTopRight) < ((GVAR(freeDrawingData) select 1) distance2d _posTopRight)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; + if ((_currentMousePos distance2d _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; }; - private _screenPosOfCorrectedPos = _theMap ctrlMapWorldToScreen _currentMousePos; + + private _screenPosOfCorrectedPos = _mapCtrl ctrlMapWorldToScreen _currentMousePos; setMousePosition _screenPosOfCorrectedPos; }; case (_currentMousePos inPolygon [_posCenter, _posBottomLeft, _posBottomRight]): { // Bottom - private _distanceToRoamerLine = ([_posBottomLeft, _posBottomRight, _currentMousePos] call _fnc_Distance); - _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, (GVAR(mapTool_angle) + 180) ,0] call CBA_fnc_polar2vect); + private _distanceToRoamerLine = [_posBottomLeft, _posBottomRight, _currentMousePos] call _fnc_distance; + + _currentMousePos = _currentMousePos vectorAdd ([_distanceToRoamerLine, GVAR(mapTool_angle) + 180, 0] call CBA_fnc_polar2vect); + if (GVAR(freeDrawingData) isEqualTo []) then { // We start drawing on the line GVAR(freeDrawingData) = ["bottom", _currentMousePos, _currentMousePos]; } else { @@ -122,23 +142,26 @@ switch (true) do { if ((_currentMousePos distance2d _posBottomLeft) < ((GVAR(freeDrawingData) select 1) distance2d _posBottomLeft)) then { GVAR(freeDrawingData) set [1, _currentMousePos]; }; + if ((_currentMousePos distance2d _posBottomRight) < ((GVAR(freeDrawingData) select 2) distance2d _posBottomRight)) then { GVAR(freeDrawingData) set [2, _currentMousePos]; }; }; }; - private _screenPosOfCorrectedPos = _theMap ctrlMapWorldToScreen _currentMousePos; + + private _screenPosOfCorrectedPos = _mapCtrl ctrlMapWorldToScreen _currentMousePos; setMousePosition _screenPosOfCorrectedPos; }; }; #ifdef DEBUG_MODE_FULL -_theMap drawIcon ['iconStaticMG',[1,0,0,1],_posTopRight,24,24,getDir player,'1,1',1,0.03,'TahomaB','right']; -_theMap drawIcon ['iconStaticMG',[1,0,0,1],_posTopLeft,24,24,getDir player,'-1,1',1,0.03,'TahomaB','right']; -_theMap drawIcon ['iconStaticMG',[1,0,0,1],_posBottomLeft,24,24,getDir player,'-1,-1',1,0.03,'TahomaB','right']; -_theMap drawIcon ['iconStaticMG',[1,0,0,1],_posBottomRight,24,24,getDir player,'1,-1',1,0.03,'TahomaB','right']; +_mapCtrl drawIcon ['iconStaticMG',[1,0,0,1],_posTopRight,24,24,getDir player,'1,1',1,0.03,'TahomaB','right']; +_mapCtrl drawIcon ['iconStaticMG',[1,0,0,1],_posTopLeft,24,24,getDir player,'-1,1',1,0.03,'TahomaB','right']; +_mapCtrl drawIcon ['iconStaticMG',[1,0,0,1],_posBottomLeft,24,24,getDir player,'-1,-1',1,0.03,'TahomaB','right']; +_mapCtrl drawIcon ['iconStaticMG',[1,0,0,1],_posBottomRight,24,24,getDir player,'1,-1',1,0.03,'TahomaB','right']; + if (GVAR(freeDrawingData) isNotEqualTo []) then { - _theMap drawIcon ['iconStaticMG',[0,0,1,1],GVAR(freeDrawingData) select 1,24,24,getDir player,'1,-1',1,0.03,'TahomaB','right']; - _theMap drawIcon ['iconStaticMG',[0,0,1,1],GVAR(freeDrawingData) select 2,24,24,getDir player,'1,-1',1,0.03,'TahomaB','right']; + _mapCtrl drawIcon ['iconStaticMG',[0,0,1,1],GVAR(freeDrawingData) select 1,24,24,getDir player,'1,-1',1,0.03,'TahomaB','right']; + _mapCtrl drawIcon ['iconStaticMG',[0,0,1,1],GVAR(freeDrawingData) select 2,24,24,getDir player,'1,-1',1,0.03,'TahomaB','right']; }; #endif diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index beee6157eb..5c35c699d7 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -1,17 +1,17 @@ #include "..\script_component.hpp" /* - * Author: esteldunedain + * Author: esteldunedain, LorenLuke * Handle mouse buttons. * * Arguments: - * 0: 1 if mouse down down, 0 if mouse button up + * 0: 1 if mouse down down, 0 if mouse button up * 1: Parameters of the mouse button event * * Return Value: - * true if event was handled + * None * * Example: - * [0, [array]] call ACE_maptools_fnc_handleMouseButton + * [0, []] call ace_maptools_fnc_handleMouseButton * * Public: No */ @@ -24,20 +24,27 @@ TRACE_2("params",_dir,_params); if ((_button == 0) && {GVAR(freedrawing) || _ctrlKey}) exitWith { if (GVAR(freedrawing) && {_dir == 0}) then { GVAR(freedrawing) = false; + if (_shiftKey) exitWith { TRACE_1("using vanilla straight line",_shiftKey); }; + TRACE_2("Ending Line",GVAR(freedrawing),GVAR(freeDrawingData)); + [{ - if (allMapMarkers isEqualTo []) exitWith {}; - private _markerName = allMapMarkers select (count allMapMarkers - 1); + if (GVAR(freeDrawingData) isEqualTo []) exitWith {TRACE_1("never touched roamer",GVAR(freeDrawingData))}; + + private _allMarkers = allMapMarkers; + + if (_allMarkers isEqualTo []) exitWith {}; + + private _markerName = _allMarkers select -1; private _markerPos = getMarkerPos _markerName; - private _distanceCheck = _markerPos distance2d GVAR(drawPosStart); + private _distanceCheck = _markerPos distance2D GVAR(drawPosStart); TRACE_3("Line Drawn",_markerName,_markerPos,_distanceCheck); - if (_distanceCheck > 1) exitWith {WARNING("Wrong Marker!");}; - if ((count GVAR(freeDrawingData)) != 3) exitWith {TRACE_1("never touched roamer",GVAR(freeDrawingData));}; + if (_distanceCheck > 1) exitWith {WARNING("Wrong Marker!")}; GVAR(freeDrawingData) params ["", "_startStraightPos", "_endStraightPos"]; @@ -54,63 +61,112 @@ if ((_button == 0) && {GVAR(freedrawing) || _ctrlKey}) exitWith { TRACE_2("Starting Line",GVAR(freedrawing),GVAR(drawPosStart)); } else { GVAR(freedrawing) = false; - TRACE_1("weird - reseting",GVAR(freedrawing)); + TRACE_1("weird - resetting",GVAR(freedrawing)); }; }; - false + + false // return +}; + +// If it's not a left button event, exit +if (_button != 0) exitWith { + false // return }; private _handled = false; -// If it's not a left button event, exit -if (_button != 0) exitWith {_handled}; - // If releasing if (_dir != 1) then { if (GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating)) then { GVAR(mapTool_isDragging) = false; GVAR(mapTool_isRotating) = false; - _handled = true; + }; + + if (GVAR(plottingBoard_isDragging) || GVAR(plottingBoard_isRotating) > -1) then { + GVAR(plottingBoard_isDragging) = false; + GVAR(plottingBoard_isRotating) = -1; }; } else { // If clicking - if !(call FUNC(canUseMapTools)) exitWith {}; + if (call FUNC(canUseMapTools)) then { + GVAR(mapTool_isDragging) = false; + GVAR(mapTool_isRotating) = false; - // Transform mouse screen position to coordinates - private _pos = _control ctrlMapScreenToWorld [_screenPosX, _screenPosY]; - _pos set [count _pos, 0]; + // If no map tool marker then exit + if (GVAR(mapTool_Shown) != 0) then { + // Transform mouse screen position to coordinates + private _pos = _control ctrlMapScreenToWorld [_screenPosX, _screenPosY]; - GVAR(mapTool_isDragging) = false; - GVAR(mapTool_isRotating) = false; + // Check if clicking the maptool + if (_pos call FUNC(isInsideMapTool)) then { + // Store data for dragging + GVAR(mapTool_startPos) = +GVAR(mapTool_pos); + GVAR(mapTool_startDragPos) = _pos; - // If no map tool marker then exit - if (GVAR(mapTool_Shown) == 0) exitWith {}; + private _rotateKeyPressed = switch (GVAR(rotateModifierKey)) do { + case 1: {_altKey}; + case 2: {_ctrlKey}; + case 3: {_shiftKey}; + default {false}; + }; - // Check if clicking the maptool - if (_pos call FUNC(isInsideMapTool)) exitWith { - // Store data for dragging - GVAR(mapTool_startPos) = + GVAR(mapTool_pos); - GVAR(mapTool_startDragPos) = + _pos; + if (_rotateKeyPressed) then { + // Store data for rotating + GVAR(mapTool_startAngle) = GVAR(mapTool_angle); - private _rotateKeyPressed = switch (GVAR(rotateModifierKey)) do { - case (1): {_altKey}; - case (2): {_ctrlKey}; - case (3): {_shiftKey}; - default {false}; + private _pos = GVAR(mapTool_startDragPos) vectorDiff GVAR(mapTool_startPos); + GVAR(mapTool_startDragAngle) = ((_pos select 0) atan2 (_pos select 1) + 360) % 360; + + // Start rotating + GVAR(mapTool_isRotating) = true; + } else { + // Start dragging + GVAR(mapTool_isDragging) = true; + }; + }; }; + }; - if (_rotateKeyPressed) then { - // Store data for rotating - GVAR(mapTool_startAngle) = + GVAR(mapTool_angle); - GVAR(mapTool_startDragAngle) = (180 + ((GVAR(mapTool_startDragPos) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mapTool_startDragPos) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); - // Start rotating - GVAR(mapTool_isRotating) = true; - } else { - // Start dragging - GVAR(mapTool_isDragging) = true; + if (call FUNC(canUsePlottingBoard)) then { + GVAR(plottingBoard_isDragging) = false; + GVAR(plottingBoard_isRotating) = -1; + + if (GVAR(plottingBoard_Shown) != 0) then { + // Transform mouse screen position to coordinates + private _pos = _control ctrlMapScreenToWorld [_screenPosX, _screenPosY]; + private _click = _pos call FUNC(isInsidePlottingBoard); + + if (_click > -1) then { + GVAR(plottingBoard_startPos) = +GVAR(plottingBoard_pos); + GVAR(plottingBoard_startDragPos) = _pos; + + private _rotateKeyPressed = switch (GVAR(rotateModifierKey)) do { + case 1: {_altKey}; + case 2: {_ctrlKey}; + case 3: {_shiftKey}; + default {false}; + }; + + if (_rotateKeyPressed) then { + // Store data for rotating + private _ang = switch (_click) do { + case 1: {GVAR(plottingBoard_acrylicAngle)}; + case 2: {GVAR(plottingBoard_rulerAngle)}; + default {GVAR(plottingBoard_angle)}; + }; + + GVAR(plottingBoard_startAngle) = _ang; + + private _pos = GVAR(plottingBoard_startDragPos) vectorDiff GVAR(plottingBoard_startPos); + GVAR(plottingBoard_startDragAngle) = ((_pos select 0) atan2 (_pos select 1) + 360) % 360; + + // Start rotating + GVAR(plottingBoard_isRotating) = _click; + } else { + // Start dragging + GVAR(plottingBoard_isDragging) = true; + }; + }; }; - _handled = true; }; }; - -_handled diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 5af4f02e30..3092d2d532 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -1,49 +1,66 @@ #include "..\script_component.hpp" /* - * Author: esteldunedain - * Handle mouse movement over the map tool. + * Author: esteldunedain, LorenLuke + * Handle mouse movement over the map tool and plotting board. * * Arguments: - * 0: Map Control - * 1: Mouse position on screen coordinates + * 0: Map control + * 1: Mouse x position + * 2: Mouse y position * * Return Value: - * true if event was handled + * None * * Example: - * [CONTROL, [0, 5, 1]] call ACE_maptools_fnc_handleMouseMove + * [CONTROL, [0, 5]] call ace_maptools_fnc_handleMouseMove * * Public: No */ -params ["_control", "_mousePosX", "_mousePosY"]; -TRACE_3("params",_control,_mousePosX,_mousePosY); +params ["_mapCtrl", "_mousePosX", "_mousePosY"]; +TRACE_3("params",_mapCtrl,_mousePosX,_mousePosY); // If have no map tools, then exit -if (((isNull ACE_player) || {!("ACE_MapTools" in (ACE_player call EFUNC(common,uniqueItems)))})) exitWith { - false -}; +if (isNull ACE_player || { + private _uniqueItems = ACE_player call EFUNC(common,uniqueItems); + + !(("ACE_MapTools" in _uniqueItems) || {"ACE_PlottingBoard" in _uniqueItems}) +}) exitWith {}; // If map tools not shown, then exit -if (GVAR(mapTool_Shown) == 0) exitWith {false}; +if (GVAR(mapTool_Shown) == 0 && {GVAR(plottingBoard_Shown) == 0}) exitWith {false}; -private _mousePosition = _control ctrlMapScreenToWorld [_mousePosX, _mousePosY]; +private _mousePosition = _mapCtrl ctrlMapScreenToWorld [_mousePosX, _mousePosY]; -// Translation +// Map tools - translation if (GVAR(mapTool_isDragging)) exitWith { - GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (_mousePosition select 0) - (GVAR(mapTool_startDragPos) select 0)]; - GVAR(mapTool_pos) set [1, (GVAR(mapTool_startPos) select 1) + (_mousePosition select 1) - (GVAR(mapTool_startDragPos) select 1)]; - - true + GVAR(mapTool_pos) = GVAR(mapTool_startPos) vectorAdd _mousePosition vectorDiff GVAR(mapTool_startDragPos); }; -// Rotation +// Map tools - rotation if (GVAR(mapTool_isRotating)) exitWith { // Get new angle - private _angle = (180 + ((_mousePosition select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((_mousePosition select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); - GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle); + private _pos = _mousePosition vectorDiff GVAR(mapTool_startPos); + private _angle = (_pos select 0) atan2 (_pos select 1); - true + GVAR(mapTool_angle) = ((GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle)) % 360 + 360) % 360; }; -false +// Plotting board - translation +if (GVAR(plottingBoard_isDragging)) exitWith { + GVAR(plottingBoard_pos) = GVAR(plottingBoard_startPos) vectorAdd _mousePosition vectorDiff GVAR(plottingBoard_startDragPos); +}; + +// Plotting board - rotation +if (GVAR(plottingBoard_isRotating) > -1) exitWith { + // Get new angle + private _pos = _mousePosition vectorDiff GVAR(plottingBoard_startPos); + private _angle = (_pos select 0) atan2 (_pos select 1); + private _returnAngle = ((GVAR(plottingBoard_startAngle) + _angle - GVAR(plottingBoard_startDragAngle)) % 360 + 360) % 360; + + switch (GVAR(plottingBoard_isRotating)) do { + case 0: {GVAR(plottingBoard_angle) = _returnAngle}; + case 1: {GVAR(plottingBoard_acrylicAngle) = _returnAngle}; + case 2: {GVAR(plottingBoard_rulerAngle) = _returnAngle}; + }; +}; diff --git a/addons/maptools/functions/fnc_handlePlottingBoardMarkers.sqf b/addons/maptools/functions/fnc_handlePlottingBoardMarkers.sqf new file mode 100644 index 0000000000..b7a0c7657a --- /dev/null +++ b/addons/maptools/functions/fnc_handlePlottingBoardMarkers.sqf @@ -0,0 +1,219 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke, johnb43 + * Handle map marker creation. + * If a marker is (partially) on the plotting board, the parts on the plotting board are attached to the plotting board + * and move with the board accordingly. + * + * Arguments: + * 0: Arguments + * - 0: Marker name + * - 1: Chat channel number + * - 2: Marker owner + * - 3: Local origin + * 1: Deleted + * + * Return Value: + * None + * + * Example: + * [CONTROL, [0, 5]] call ace_maptools_fnc_handlePlottingBoardMarkers + * + * Public: No + */ + +params ["_args", "_deleted"]; +_args params ["_marker", "_channelNumber", "_owner", "_local"]; + +if (_deleted) exitWith { + GVAR(plottingBoard_markers) deleteAt _marker; +}; + +// Do not process non-local or already processed markers, don't check if the plotting board isn't shown +if (!_local || {GVAR(plottingBoard_Shown) == 0} || {QUOTE(ADDON) in _marker}) exitWith {}; + +// Check if the channel the marker was made in can be marked on the plotting board +private _continue = true; + +if (isMultiplayer) then { + switch (GVAR(plottingBoardAllowChannelDrawing)) do { + case 0: { + if (_channelNumber != 5) then {_continue = false}; + }; + case 1: { + if !(_channelNumber in [3, 5]) then {_continue = false}; + }; + }; +}; + +if (!_continue) exitWith {}; + +private _boardPos = GVAR(plottingBoard_pos); +private _boardAng = GVAR(plottingBoard_acrylicAngle); + +private _markerPolyline = markerPolyline _marker; +private _count = count _markerPolyline; + +// If the marker is not a polyline marker +if (_count == 0) exitWith { + private _diffPos = (getMarkerPos _marker) vectorDiff _boardPos; + + // If the marker is on the acrylic or ruler of the plotting board, save it + if (vectorMagnitude _diffPos < PLOTTINGBOARD_DRAWRANGE) then { + private _relPos = [[0, 0], _diffPos, _boardAng] call CBA_fnc_vectRotate2D; + + GVAR(plottingBoard_markers) set [_marker, [_relPos, [], _boardAng, +_boardPos, 1]]; + }; +}; + +// If the marker is a polyline marker, but doesn't have enough components (happens when you ctrl-left click on the map), ignore +if (_count <= 4) exitWith {}; + +// Polyine markers (lines) +private _startPos = []; +private _endPos = []; +private _dir = []; +private _diffPos = []; + +private _a = 0; +private _b = 0; +private _c = 0; +private _t1 = nil; +private _t2 = nil; +private _delta = 0; + +private _intersectionValid1 = false; +private _intersectionValid2 = false; +private _intersectPoint1 = []; +private _intersectPoint2 = []; +private _intersectClose = []; +private _intersectFar = []; + +private _polylineIndex = 0; +private _markerArray = [[]]; +private _insideArray = []; + +for "_i" from 0 to _count - 1 - 2 step 2 do { + _startPos = [_markerPolyline select _i, _markerPolyline select (_i + 1)]; + _endPos = [_markerPolyline select (_i + 2), _markerPolyline select (_i + 3)]; + _dir = _endPos vectorDiff _startPos; + _diffPos = _startPos vectorDiff _boardPos; + + // Circle-line intersection: Check for intersections between plotting board and current piece of polyline + // https://stackoverflow.com/a/1084899 + _a = _dir vectorDotProduct _dir; + _b = 2 * (_diffPos vectorDotProduct _dir); + _c = (_diffPos vectorDotProduct _diffPos) - PLOTTINGBOARD_DRAWRANGE^2; + + _delta = _b^2 - 4 * _a * _c; + + // Stretch factors + _t1 = nil; + _t2 = nil; + + if (_delta > 0) then { + _t1 = (-_b + sqrt _delta) / (2 * _a); + _t2 = (-_b - sqrt _delta) / (2 * _a); + + // Don't look for intersection points beyond the start or end points + if (_t1 < 0 || _t1 > 1) then { + _t1 = nil; + }; + + if (_t2 < 0 || _t2 > 1) then { + _t2 = nil; + }; + }; + + // The current point is always part of a polyline + (_markerArray param [_polylineIndex, []]) append _startPos; + _insideArray set [_polylineIndex, vectorMagnitude _diffPos < PLOTTINGBOARD_DRAWRANGE]; // keep track if point is within plotting board + + _intersectionValid1 = !isNil "_t1"; + _intersectionValid2 = !isNil "_t2"; + + // If no valid intersection points, continue + if (!_intersectionValid1 && {!_intersectionValid2}) then { + continue; + }; + + // Extremely rare case if the marker is tangential to the plotting board: Ignore + if (_intersectionValid1 && {_intersectionValid2} && {_t1 == _t2}) then { + continue; + }; + + if (_intersectionValid1) then { + _intersectPoint1 = _startPos vectorAdd (_dir vectorMultiply _t1); + }; + + if (_intersectionValid2) then { + _intersectPoint2 = _startPos vectorAdd (_dir vectorMultiply _t2); + }; + + // When a marker crosses the plotting board entirely (one straight line through the plotting board) + if (_intersectionValid1 && {_intersectionValid2}) then { + // Take the closer point first + _intersectClose = [_intersectPoint1, _intersectPoint2] select (_t1 > _t2); + + // Finish previous polyline with the last point being the intersection + (_markerArray select _polylineIndex) append _intersectClose; + + // Create a new polyline, with the first point being the closest intersection + _polylineIndex = _polylineIndex + 1; + _markerArray set [_polylineIndex, _intersectClose]; + + // Now take the point further away + _intersectFar = [_intersectPoint1, _intersectPoint2] select (_t1 < _t2); + + // Make a polyline between the intersection points + (_markerArray select _polylineIndex) append _intersectClose; + (_markerArray select _polylineIndex) append _intersectFar; + _insideArray set [_polylineIndex, true]; // with 2 intersections, this part of the polyline must be inside + + // Create a new polyline, with the first point being the furthest intersection + _polylineIndex = _polylineIndex + 1; + _markerArray set [_polylineIndex, _intersectFar]; + } else { + // Only 1 intersection (either point 1 or 2, exclusive or) + if (_intersectionValid2) then { + _intersectPoint1 = _intersectPoint2; + }; + + // Finish previous polyline with the last point being the intersection + (_markerArray select _polylineIndex) append _intersectPoint1; + + // Create a new polyline, with the first point being the intersection + _polylineIndex = _polylineIndex + 1; + _markerArray set [_polylineIndex, _intersectPoint1]; + }; +}; + +// If there were no polyline intersections and the marker was not on the plotting board, don't create new markers +if (_insideArray isEqualTo [false]) exitWith {}; + +private _color = getMarkerColor _marker; +private _name = ""; +private _polylineRelative = []; +private _relPos = []; + +{ + _name = format ["%1-%2-%3", _marker, _forEachIndex, QUOTE(ADDON)]; // adding an identifier allow to check if marker was already processed + createMarkerLocal [_name, [0, 0], _channelNumber, _owner]; + _name setMarkerColorLocal _color; + _name setMarkerPolyline _x; // global marker broadcast + + // If the marker was on the plotting board, take it's unrotated position and store it + if (_insideArray select _forEachIndex) then { + _polylineRelative = []; + + for "_i" from 0 to count _x - 1 step 2 do { + _relPos = [[0, 0], [_x select _i, _x select (_i + 1)] vectorDiff _boardPos, _boardAng] call CBA_fnc_vectRotate2D; + _polylineRelative append _relPos; + }; + + GVAR(plottingBoard_markers) set [_name, [[0, 0], +_polylineRelative, _boardAng, +_boardPos, 1]]; + }; +} forEach _markerArray; + +// Delete original marker +deleteMarker _marker; diff --git a/addons/maptools/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf index f6c633d885..ad80357411 100644 --- a/addons/maptools/functions/fnc_isInsideMapTool.sqf +++ b/addons/maptools/functions/fnc_isInsideMapTool.sqf @@ -4,32 +4,32 @@ * Return true if the position is inside the map marker (to allow dragging). * * Arguments: - * 0: x Position (in meters) - * 1: y Position (in meters) + * 0: x position (in meters) + * 1: y position (in meters) * * Return Value: - * Boolean + * Is inside map tool * * Example: - * [0, 5] call ACE_maptools_fnc_isInsideMapTool + * [0, 5] call ace_maptools_fnc_isInsideMapTool * * Public: No */ if (GVAR(mapTool_Shown) == 0) exitWith {false}; + private _textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); -private _pos = [_this select 0, _this select 1, 0]; -private _relPos = _pos vectorDiff [GVAR(mapTool_pos) select 0, GVAR(mapTool_pos) select 1, 0]; -private _dirVector = [sin(GVAR(mapTool_angle)), cos(GVAR(mapTool_angle)), 0]; +private _relPos = _this vectorDiff GVAR(mapTool_pos); +private _dirVector = [sin GVAR(mapTool_angle), cos GVAR(mapTool_angle)]; // Projection of the relative position over the longitudinal axis of the map tool private _lambdaLong = _dirVector vectorDotProduct _relPos; + if (_lambdaLong < DIST_BOTTOM_TO_CENTER_PERC * _textureWidth) exitWith {false}; - -// Projection of the relative position over the trasversal axis of the map tool -private _lambdaTrasAbs = vectorMagnitude (_relPos vectorDiff (_dirVector vectorMultiply _lambdaLong)); if (_lambdaLong > DIST_TOP_TO_CENTER_PERC * _textureWidth) exitWith {false}; -if (_lambdaTrasAbs > DIST_LEFT_TO_CENTER_PERC * _textureWidth) exitWith {false}; -true +// Projection of the relative position over the transversal axis of the map tool +private _lambdaTransAbs = vectorMagnitude (_relPos vectorDiff (_dirVector vectorMultiply _lambdaLong)); + +_lambdaTransAbs <= DIST_LEFT_TO_CENTER_PERC * _textureWidth diff --git a/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf b/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf new file mode 100644 index 0000000000..e3e6467508 --- /dev/null +++ b/addons/maptools/functions/fnc_isInsidePlottingBoard.sqf @@ -0,0 +1,56 @@ +#include "..\script_component.hpp" +/* + * Author: LorenLuke + * Return if the position is inside the map marker (to allow dragging) or not. + * + * Arguments: + * 0: x position (in meters) + * 1: y position (in meters) + * + * Return Value: + * Where in the plotting board it is + * -1 - Nowhere, 0 - In the Board, 1 - In the Acrylic, 2 - In the Ruler + * + * Example: + * [0, 5] call ace_maptools_fnc_isInsidePlottingBoard + * + * Public: No + */ + +if (GVAR(plottingBoard_Shown) == 0) exitWith {-1}; + +private _relPos = _this vectorDiff GVAR(plottingBoard_pos); +private _dist = vectorMagnitude _relPos; + +private _isRuler = if (GVAR(plottingBoard_Shown) == 2) then { + // If it's within these bounds, it's going to be on the ruler + if (_dist <= PLOTTINGBOARD_RULERCENTER) exitWith {true}; + + private _rulerVector = [sin GVAR(plottingBoard_rulerAngle), cos GVAR(plottingBoard_rulerAngle)]; + private _dirRightVector = [_dirVector select 1, -(_dirVector select 0)]; + private _rulerAng = acos (_rulerVector vectorCos _relPos); + + if (cos _rulerAng > 0 && {(tan _rulerAng) * _dist < PLOTTINGBOARD_RULERHALFWIDTH}) exitWith {true}; + + _dist > PLOTTINGBOARD_RULERINNERCIRCLE && {_dist < PLOTTINGBOARD_RULEROUTERCIRCLE && {abs (_rulerAng * DEGTOMILS) < PLOTTINGBOAR_RULEROUTERHALFANGLE}} +} else { + false +}; + +if (_isRuler) exitWith {2}; + +// If it's within 3000 meters, it's going to be on the acrylic +if (_dist < PLOTTINGBOARD_RULEROUTERCIRCLE) exitWith {1}; + +private _dirVector = [sin GVAR(plottingBoard_angle), cos GVAR(plottingBoard_angle)]; +private _dirRightVector = [_dirVector select 1, -(_dirVector select 0)]; + +// Projection of the relative position over the longitudinal axis of the map tool +private _ang = _dirVector vectorCos _relPos; +private _ang2 = _dirRightVector vectorCos _relPos; + +private _relPosAdjusted = [_ang2 * _dist / PLOTTINGBOARD_DRAWRANGE, _ang * _dist / PLOTTINGBOARD_DRAWRANGE]; + +if ((_relPosAdjusted select 0 > 0) && (_relPosAdjusted select 0 < 1) && (abs (_relPosAdjusted select 1) < 1)) exitWith {0}; + +-1 diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index 4cfd9be238..6d18436625 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -1,34 +1,39 @@ #include "..\script_component.hpp" /* * Author: esteldunedain, PabstMirror - * update gps display, called from main map's draw + * Update GPS display, called from main map's draw. * * Arguments: - * 0: Map ctrl + * 0: Map control * * Return Value: * None * * Example: - * [findDisplay 12 displayCtrl 51] call ACE_maptools_fnc_openMapGpsUpdate; + * [findDisplay 12 displayCtrl 51] call ace_maptools_fnc_openMapGpsUpdate; * * Public: No */ params ["_mapCtrl"]; + private _mapDisplay = ctrlParent _mapCtrl; -if ((!GVAR(mapGpsShow)) || {!(call FUNC(canUseMapGPS))}) exitWith { +if (!GVAR(mapGpsShow) || {!(call FUNC(canUseMapGPS))}) exitWith { (_mapDisplay displayCtrl 913589) ctrlShow false; }; + (_mapDisplay displayCtrl 913589) ctrlShow true; if (CBA_missionTime < GVAR(mapGpsNextUpdate)) exitWith {}; + GVAR(mapGpsNextUpdate) = CBA_missionTime + 0.5; private _ctrl = _mapDisplay displayCtrl 913590; _ctrl ctrlSetText str (round (getDir ACE_player)); // Set Heading + _ctrl = _mapDisplay displayCtrl 913591; _ctrl ctrlSetText str (round ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude)); // Set Altitude + _ctrl = _mapDisplay displayCtrl 913592; _ctrl ctrlSetText mapGridPosition ACE_player; // Set grid cords diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 34642c5c68..1a6d83b698 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -1,56 +1,130 @@ #include "..\script_component.hpp" /* - * Author: esteldunedain - * Update the map tool markers, position, size, rotation and visibility. + * Author: esteldunedain, LorenLuke + * Update the map tool and plotting board markers. Update their position, size, rotation and visibility. * * Arguments: - * 0: The Map + * 0: Map control * * Return Value: * None * * Example: - * [CONTROL] call ACE_maptools_fnc_updateMapToolMarkers + * [CONTROL] call ace_maptools_fnc_updateMapToolMarkers * * Public: No */ -params ["_theMap"]; +params ["_mapCtrl"]; -if ((GVAR(mapTool_Shown) == 0) || {!("ACE_MapTools" in (ACE_player call EFUNC(common,uniqueItems)))}) exitWith {}; - -// open map tools in center of screen when toggled to be shown -if (GVAR(mapTool_moveToMouse)) then { - private _mousePosition = _theMap ctrlMapScreenToWorld getMousePosition; - GVAR(mapTool_pos) = _mousePosition; - GVAR(mapTool_moveToMouse) = false; // we only need to do this once after opening the map tool -}; - -private _rotatingTexture = ""; -private _textureWidth = 0; -if (GVAR(mapTool_Shown) == 1) then { - _rotatingTexture = QPATHTOF(data\mapToolRotatingNormal.paa); - _textureWidth = TEXTURE_WIDTH_IN_M; +if (GVAR(plottingBoard_Shown) == 0) then { + // Hide all plotting board markers when board is put away + { + if (_y select 4 != 0) then { + _x setMarkerAlpha 0; + _y set [4, 0]; + }; + } forEach GVAR(plottingBoard_markers); } else { - _rotatingTexture = QPATHTOF(data\mapToolRotatingSmall.paa); - _textureWidth = TEXTURE_WIDTH_IN_M / 2; + if !([ACE_player, "ACE_PlottingBoard"] call EFUNC(common,hasItem)) exitWith {}; + + if (GVAR(plottingBoard_moveToMouse)) then { + GVAR(plottingBoard_pos) = _mapCtrl ctrlMapScreenToWorld getMousePosition; + GVAR(plottingBoard_moveToMouse) = false; // we only need to do this once after opening the map tool + }; + + getResolution params ["_resWidth", "_resHeight", "", "", "_aspectRatio"]; + private _scaleX = 32 * PLOTTINGBOARD_TEXTUREWIDTH * CONSTANT_SCALE * (call FUNC(calculateMapScale)); + private _scaleY = _scaleX * ((_resWidth / _resHeight) / _aspectRatio); // handle bad aspect ratios + + _mapCtrl drawIcon [QPATHTOF(data\plottingBoardBack.paa), [1, 1, 1, 1], GVAR(plottingBoard_pos), _scaleX, _scaleY, GVAR(plottingBoard_angle), "", 0]; + _mapCtrl drawIcon [QPATHTOF(data\plottingBoardAcrylic.paa), [1, 1, 1, 1], GVAR(plottingBoard_pos), _scaleX, _scaleY, GVAR(plottingBoard_acrylicAngle), "", 0]; + + // Show ruler + if (GVAR(plottingBoard_Shown) == 2) then { + _mapCtrl drawIcon [QPATHTOF(data\plottingBoardRuler.paa), [1, 1, 1, 1], GVAR(plottingBoard_pos), _scaleX, _scaleY, GVAR(plottingBoard_rulerAngle), "", 0]; + }; + + private _marker = ""; + private _angle = GVAR(plottingBoard_acrylicAngle); + private _boardPos = GVAR(plottingBoard_pos); + private _count = -1; + private _rotatedPolyPos = []; + private _rotatedPos = []; + + { + _marker = _x; + _y params ["_markerPos", "_polyline", "_lastAngle", "_lastBoardPos", "_lastAlpha"]; + + // Show all plotting board markers when the board is shown + if (_lastAlpha != 1) then { + _marker setMarkerAlpha 1; + _y set [4, 1]; + }; + + // If nothing has changed, don't update marker + if (_angle == _lastAngle && {_boardPos isEqualTo _lastBoardPos}) then { + continue; + }; + + _count = count _polyline; + + // Rotate all points of polyline + if (_count >= 4) then { // polylines need at least 2 points (2 components per point) + _rotatedPolyline = []; + + for "_i" from 0 to _count - 1 step 2 do { + _rotatedPolyPos = [[0, 0], [_polyline select _i, _polyline select (_i + 1)], -_angle] call CBA_fnc_vectRotate2D; + _rotatedPolyline append (_rotatedPolyPos vectorAdd _boardPos); + }; + + _marker setMarkerPolyline _rotatedPolyline; + }; + + // Rotate marker position, regardless of marker type + _rotatedPos = [[0, 0], _markerPos, -_angle] call CBA_fnc_vectRotate2D; + + _marker setMarkerPos (_boardPos vectorAdd _rotatedPos); + + _y set [2, _angle]; + _y set [3, +_boardPos]; + } forEach GVAR(plottingBoard_markers); }; -if (GVAR(freedrawing)) then {[_theMap, _textureWidth] call FUNC(drawLinesOnRoamer);}; +if ((GVAR(mapTool_Shown) != 0) && {[ACE_player, "ACE_MapTools"] call EFUNC(common,hasItem)}) then { + // Open map tools in center of screen when toggled to be shown + if (GVAR(mapTool_moveToMouse)) then { + GVAR(mapTool_pos) = _mapCtrl ctrlMapScreenToWorld getMousePosition; + GVAR(mapTool_moveToMouse) = false; // we only need to do this once after opening the map tool + }; -// Update scale of both parts -getResolution params ["_resWidth", "_resHeight", "", "", "_aspectRatio"]; -private _scaleX = 32 * _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); -private _scaleY = _scaleX; + private _rotatingTexture = ""; + private _textureWidth = 0; -// Position of the fixed part -private _xPos = GVAR(mapTool_pos) select 0; -private _yPos = (GVAR(mapTool_pos) select 1) + _textureWidth * CENTER_OFFSET_Y_PERC; + if (GVAR(mapTool_Shown) == 1) then { + _rotatingTexture = QPATHTOF(data\mapToolRotatingNormal.paa); + _textureWidth = TEXTURE_WIDTH_IN_M; + } else { + _rotatingTexture = QPATHTOF(data\mapToolRotatingSmall.paa); + _textureWidth = TEXTURE_WIDTH_IN_M / 2; + }; -_theMap drawIcon [QPATHTOF(data\mapToolFixed.paa), [1,1,1,1], [_xPos,_yPos], _scaleX, _scaleY, 0, "", 0]; + if (GVAR(freedrawing)) then { + [_mapCtrl, _textureWidth] call FUNC(drawLinesOnRoamer); + }; -// Position and rotation of the rotating part -_xPos = (GVAR(mapTool_pos) select 0) + sin(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; -_yPos = (GVAR(mapTool_pos) select 1) + cos(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; + // Update scale of both parts + getResolution params ["_resWidth", "_resHeight", "", "", "_aspectRatio"]; + private _scaleX = 32 * _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); + private _scaleY = _scaleX * ((_resWidth / _resHeight) / _aspectRatio); // handle bad aspect ratios -_theMap drawIcon [_rotatingTexture, [1,1,1,1], [_xPos,_yPos], _scaleX, _scaleY, GVAR(mapTool_angle), "", 0]; + // Position of the fixed part + private _pos = GVAR(mapTool_pos) vectorAdd [0, _textureWidth * CENTER_OFFSET_Y_PERC]; + + _mapCtrl drawIcon [QPATHTOF(data\mapToolFixed.paa), [1, 1, 1, 1], _pos, _scaleX, _scaleY, 0, "", 0]; + + // Position and rotation of the rotating part + _pos = GVAR(mapTool_pos) vectorAdd ([sin GVAR(mapTool_angle), cos GVAR(mapTool_angle)] vectorMultiply (_textureWidth * CENTER_OFFSET_Y_PERC)); + + _mapCtrl drawIcon [_rotatingTexture, [1, 1, 1, 1], _pos, _scaleX, _scaleY, GVAR(mapTool_angle), "", 0]; +}; diff --git a/addons/maptools/functions/fnc_wipeMarkers.sqf b/addons/maptools/functions/fnc_wipeMarkers.sqf new file mode 100644 index 0000000000..5131e469a3 --- /dev/null +++ b/addons/maptools/functions/fnc_wipeMarkers.sqf @@ -0,0 +1,23 @@ +#include "../script_component.hpp" +/* + * Author: LorenLuke + * Delete all markers on the plotting board. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_maptools_fnc_wipeMarkers + * + * Public: No + */ + +{ + deleteMarker _x; +} forEach (keys GVAR(plottingBoard_markers)); + +// Reset list +GVAR(plottingBoard_markers) = createHashMap; diff --git a/addons/maptools/initSettings.inc.sqf b/addons/maptools/initSettings.inc.sqf index cbb8e9c1b8..172054ff77 100644 --- a/addons/maptools/initSettings.inc.sqf +++ b/addons/maptools/initSettings.inc.sqf @@ -1,4 +1,4 @@ -private _category = format ["ACE %1", localize LSTRING(Name)]; +private _category = format ["ACE %1", LLSTRING(Name)]; [ QGVAR(rotateModifierKey), "LIST", @@ -15,3 +15,11 @@ private _category = format ["ACE %1", localize LSTRING(Name)]; true, 0 ] call CBA_fnc_addSetting; + +[ + QGVAR(plottingBoardAllowChannelDrawing), "LIST", + [LSTRING(allowChannelDrawing_displayName), LSTRING(allowChannelDrawing_description)], + _category, + [[0, 1], [LSTRING(allowDirectCommsOnly), LSTRING(allowDirectGroupComms)], 1], + 0 +] call CBA_fnc_addSetting; diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp index 4710caa7a3..adbc1fb3f6 100644 --- a/addons/maptools/script_component.hpp +++ b/addons/maptools/script_component.hpp @@ -16,9 +16,19 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define TEXTURE_WIDTH_IN_M 6205 -#define CENTER_OFFSET_Y_PERC 0.1606 -#define CONSTANT_SCALE 0.2 +#define DEGTOMILS 17.7777778 + +#define TEXTURE_WIDTH_IN_M 6205 +#define CENTER_OFFSET_Y_PERC 0.1606 +#define CONSTANT_SCALE 0.2 #define DIST_BOTTOM_TO_CENTER_PERC -0.33 -#define DIST_TOP_TO_CENTER_PERC 0.65 -#define DIST_LEFT_TO_CENTER_PERC 0.30 +#define DIST_TOP_TO_CENTER_PERC 0.65 +#define DIST_LEFT_TO_CENTER_PERC 0.30 + +#define PLOTTINGBOARD_DRAWRANGE 3000 +#define PLOTTINGBOARD_TEXTUREWIDTH 6000 +#define PLOTTINGBOARD_RULERCENTER 450 +#define PLOTTINGBOARD_RULERHALFWIDTH 100 +#define PLOTTINGBOARD_RULERINNERCIRCLE 2900 +#define PLOTTINGBOARD_RULEROUTERCIRCLE 3000 +#define PLOTTINGBOARD_RULEROUTERHALFANGLE 100 diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml index 7ab1662bb2..bb0782f22b 100644 --- a/addons/maptools/stringtable.xml +++ b/addons/maptools/stringtable.xml @@ -12,7 +12,7 @@ Ferramentas de Mapa Térképészeti eszközök Инструменты карты - マップ ツール + マップツール 독도용 도구 地图工具 地圖工具 @@ -29,12 +29,28 @@ 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. Картографические инструменты позволяют измерять расстояния и углы на карте. - マップ ツールは地図上で距離や角度を測れます。 + マップツールは地図上で距離や角度を測れます。 독도용 도구는 지도상에서 거리나 각도를 잴 수 있게 해줍니다. 地图工具能够让你在地图上测量距离与角度 地圖工具能夠讓你在地圖上測量距離與角度 Harita Araçları, haritadaki mesafeleri ve açıları ölçmenize olanak tanır. + + Plotting Board + 플로팅 보드 + 標定盤 + Tavola di calcolo + Графическая доска + Planche traçante + + + The Plotting Board is a map tool designed for use in the directing of short range indirect fires. + 플로팅 보드는 단거리 간접 사격을 지시하는 데 사용하도록 설계된 독도용 도구입니다. + 標定盤(プロッティング・ボード)は、短距離の間接射撃の指示に使用するために設計されたマップツールです。 + La tavola di calcolo è uno strumento utilizzato per dirigere fuoco di artiglieria a corto raggio. + Графическая доска - это картографический инструмент, предназначенный для использования при ведении непрямого огня с малой дистанции. + Une planche traçante est un outil cartographique conçu pour diriger des tirs indirects à courte distance. + Map Tools Herramientas de mapa @@ -46,7 +62,7 @@ Ferramentas de Mapa Térképészeti eszközök Инструменты карты - マップ ツール + マップツール 독도용 도구 地图工具 地圖工具 @@ -192,7 +208,7 @@ Rotate Map Tools Key Touche de rotation des outils de navigation Клавиша поворота инструментов карты - マップ ツールの回転キー + マップツールの回転キー Klawisz obrotu narzędzi nawigacyjnych Taste zum Drehen des Kartenwerkzeugs 독도용 도구 돌리기 키 @@ -208,7 +224,7 @@ Modifier key to allow rotating map tools Touche modificatrice permettant la rotation des outils de navigation. Клавиша-модификатор, позволяющая поворачивать инструменты карты - マップ ツールを回転させるキーを編集できます。 + マップツールを回転させるキーを編集できます。 Modyfikator pozwalający na obracanie narzędzi nawigacyjnych Steuerungstaste, um Drehung des Kartenwerkzeugs zu ermöglichen. 독도용 도구를 돌리기 위한 키를 변경할 수 있습니다. @@ -222,7 +238,7 @@ Draw straight lines with maptools - マップ ツールを使って直線を書く + マップツールを使って直線を書く Zeichne gerade Linien mit dem Kartenwerkzeug 독도용 도구로 직선 그리기 Rysuj proste linie przy użyciu narzędzi nawigacyjnych @@ -252,5 +268,175 @@ Düz çizgiler çizmek için maptools'un kenarına çizin. Not: Silmek için orta noktada fareyle üzerine gelmeniz gerekir. Dibujar sobre el borde de las herramientas de mapa para dibujar líneas rectas. Nota: Debe situarse en el punto intermedio para eliminarla. + + Allow Plotting Board Drawing channels + 標定盤への書き込みを許可するチャンネル + 플로팅 보드 그리기 채널 허용 + Canali ammessi su tavola di calcolo + Разрешить создание каналов на миллиметровой доске. + Canaux autorisés sur la planche traçante + + + Channels in which plotting board drawing is enabled. + どのチャンネルで標定盤の書き込みを有効化するか。 + 플로팅 보드 그리기가 활성화된 채널입니다. + Canali in cui si può disegnare sulla tavola di calcolo. + Каналы, в которых включено рисование на миллиметровой доске. + Canaux dans lesquels vous pouvez dessiner sur le planche traçante + + + Allow Direct Comms Only (Polylines Only) + 直接チャンネルのみ許可 (線のみ) + 직접교신만 허용 (선 긋기만) + Comunicazioni Dirette (solo linee) + Разрешать только прямую связь (только полилинии) + Communications directes uniquement (lignes uniquement) + + + Allow Direct/Group Comms (Polylines and Group Markers) + 直接/グループチャンネルを許可 (線とグループマーカー) + 직접교신/그룹무전망 허용 (선 긋기와 그룹 마커) + Comunicazioni dirette/gruppo (linee e marker) + Разрешить прямую/групповую связь (полилинии и групповые маркеры) + Autoriser les communications directes/de groupe (polylignes et marqueurs de groupe) + + + Plotting Board + 標定盤 + 플로팅 보드 + Tavola di calcolo + Миллиметровая доска + Planche traçante + + + Plotting Board Acrylic + 標定盤の アクリル板 + 플로팅 보드 (아크릴) + Acrilico tavola di calcolo + Миллиметровая доска акрилловая + Planche traçante Acrylique + + + Plotting Board Ruler + 標定盤の 定規 + 플로팅 보드 (자) + Righello tavola di calcolo + Линейка для миллиметровой доски + Règle de la planche traçante + + + To Plotting Board + 標定盤に + 플로팅 보드에 + Su tavola di calcolo + К миллиметровой доске. + Sur la planche traçante + + + To Plotting Board Acrylic + 標定盤の アクリル板に + 플로팅 보드 (아크릴)에 + Su acrilico tavola di calcolo + К миллиметровой доске акрилловой + Sur la planche traçante Acrylique + + + To Plotting Board Ruler + 標定盤の 定規に + 플로팅 보드 (자)에 + Su righello tavola di calcolo + К линейке миллиметровой доски. + Sur la règle de la planche traçante + + + Wipe all markers off Plotting Board + 標定盤の 全マーカーを 拭き消す + 플로팅 보드에 있는 모든 마커 지우기 + Cancella tutti i disegni dalla tavola + Сотрите все маркеры с миллиметровой доски. + Effacer tous les dessins de la planche traçante + + + Show Plotting Board + 標定盤を 表示 + 플로팅 보드 보이기 + Mostra tavola di calcolo + Показать миллиметровую доску. + Afficher la planche traçante + + + Hide Plotting Board + 標定盤を 隠す + 플로팅 보드 숨기기 + Nascondi tavola di calcolo + Скрыть миллиметровую доску. + Masquer la planche traçante + + + Toggle Plotting Board Ruler + 標定盤の 定規を 表示切替 + 플로팅 보드 (자) 토글 + Mostra/Nascondi Righello + Переключить линейку миллиметровой доски. + Afficher/masquer la règle + + + Align + Ausrichten + Alinear + Aligner + Allinea + Alinhar + Állítása + Wyrównaj + Srovnat + Выровнять + 맞춤 기준: + 向きを合わせる + + + To North + Nach Norden + Al norte + Sur le nord + Con il Nord + Com o Norte + Északhoz + Do północy + Na sever + На север + 북쪽으로 + 北に + + + To Compass + Am Kompass + A la brújula + Sur la boussole + Con la bussola + Com a Bússola + Iránytűhöz + Do kompasu + Ke kompasu + По компасу + 方位磁石に + 나침반으로 + + + Up + 上に + 위로 + Su + Вверх + Monter + + + To Maptool + マップツールに + 독도용 도구로 + Su strumento cartografico + К инструментам карты + Outil cartographique + diff --git a/addons/marker_flags/CfgWeapons.hpp b/addons/marker_flags/CfgWeapons.hpp index b4c2f88125..13a1632f4f 100644 --- a/addons/marker_flags/CfgWeapons.hpp +++ b/addons/marker_flags/CfgWeapons.hpp @@ -14,7 +14,7 @@ class CfgWeapons { mapSize = 0.2; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 1; + mass = 0.5; }; }; diff --git a/addons/marker_flags/functions/fnc_placeFlag.sqf b/addons/marker_flags/functions/fnc_placeFlag.sqf index 74dc615588..5dd2abb376 100644 --- a/addons/marker_flags/functions/fnc_placeFlag.sqf +++ b/addons/marker_flags/functions/fnc_placeFlag.sqf @@ -18,13 +18,13 @@ */ params [["_player", objNull, [objNull]], ["_item", QGVAR(white), [""]]]; -TRACE_2("Placing flag", _player, _item); +TRACE_2("Placing flag",_player,_item); (GVAR(flagCache) get _item) params ["_vehicleClass"]; private _flag = _vehicleClass createVehicle [0, 0, 0]; -TRACE_1("Created flag", _flag); +TRACE_1("Created flag",_flag); // Set flag start height GVAR(objectHeight) = MAX_HEIGHT; diff --git a/addons/marker_flags/stringtable.xml b/addons/marker_flags/stringtable.xml index c303664144..31aab77e84 100644 --- a/addons/marker_flags/stringtable.xml +++ b/addons/marker_flags/stringtable.xml @@ -6,7 +6,7 @@ Markierungsfahnen Bandiere segnaletiche Chorągiewki - 旗マーカー + マーカー旗 마킹용 깃발 标记旗 Флажки @@ -48,7 +48,7 @@ 마킹용 깃발 꽂기 Поставить флажок Colocar Bandera de señalizado - マーカーフラッグを置く + マーカー旗 を置く Placer le drapeau de marquage Colocar Bandeira de Marcação @@ -102,7 +102,7 @@ Markierungsfahne (Weiß) Bandiera segnaletica (Bianca) Chorągiewka (Biała) - 旗マーカー (白) + マーカー旗 (白) 마킹용 깃발(하양) 标记旗(白) Флажок (белый) @@ -115,7 +115,7 @@ Markierungsfahne (Schwarz) Bandiera segnaletica (Nera) Chorągiewka (Czarna) - 旗マーカー (黒) + マーカー旗 (黒) 마킹용 깃발(검정) 标记旗(黑) Флажок (чёрный) @@ -128,7 +128,7 @@ Markierungsfahne (Rot) Bandiera segnaletica (Rossa) Chorągiewka (Czerwona) - 旗マーカー (赤) + マーカー旗 (赤) 마킹용 깃발(빨강) 标记旗(红) Флажок (красный) @@ -141,7 +141,7 @@ Markierungsfahne (Grün) Bandiera segnaletica (Verde) Chorągiewka (Zielona) - 旗マーカー (緑) + マーカー旗 (緑) 마킹용 깃발(초록) 标记旗(绿) Флажок (зелёный) @@ -154,7 +154,7 @@ Markierungsfahne (Blau) Bandiera segnaletica (Blu) Chorągiewka (Niebieska) - 旗マーカー (青) + マーカー旗 (青) 마킹용 깃발(파랑) 标记旗(蓝) Флажок (синий) @@ -167,7 +167,7 @@ Markierungsfahne (Gelb) Bandiera segnaletica (Gialla) Chorągiewka (Żółta) - 旗マーカー (黄) + マーカー旗 (黄) 마킹용 깃발(노랑) 标记旗(黄) Флажок (жёлтый) @@ -180,7 +180,7 @@ Markierungsfahne (Orange) Bandiera segnaletica (Arancione) Chorągiewka (Pomarańczowa) - 旗マーカー (橙) + マーカー旗 (橙) 마킹용 깃발(주황) 标记旗(橙) Флажок (оранжевый) @@ -193,7 +193,7 @@ Markierungsfahne (Lila) Bandiera segnaletica (Viola) Chorągiewka (Fioletowa) - 旗マーカー (紫) + マーカー旗 (紫) 마킹용 깃발(보라) 标记旗(紫) Флажок (фиолетовый) diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf index 25e8317b75..1ae489dd82 100644 --- a/addons/markers/XEH_postInit.sqf +++ b/addons/markers/XEH_postInit.sqf @@ -2,10 +2,10 @@ #include "script_component.hpp" // recieve remote marker data -[QGVAR(setMarkerNetwork), {_this call DFUNC(setMarkerNetwork)}] call CBA_fnc_addEventHandler; +[QGVAR(setMarkerNetwork), LINKFUNC(setMarkerNetwork)] call CBA_fnc_addEventHandler; // recieve marker data for JIP -[QGVAR(setMarkerJIP), {_this call DFUNC(setMarkerJIP)}] call CBA_fnc_addEventHandler; +[QGVAR(setMarkerJIP), LINKFUNC(setMarkerJIP)] call CBA_fnc_addEventHandler; // request marker data for JIP if (isMultiplayer && {!isServer} && {hasInterface}) then { @@ -32,7 +32,7 @@ GVAR(userPlacedMarkers) = []; if (_index < 0) exitWith { if (!isMultiplayer) exitWith {}; - WARNING_1("Could not find data for %1", _marker); + WARNING_1("Could not find data for %1",_marker); }; private _data = GVAR(allMapMarkersProperties) select _index; diff --git a/addons/markers/functions/fnc_onButtonClickConfirm.sqf b/addons/markers/functions/fnc_onButtonClickConfirm.sqf index 2822cd69f0..622a306e38 100644 --- a/addons/markers/functions/fnc_onButtonClickConfirm.sqf +++ b/addons/markers/functions/fnc_onButtonClickConfirm.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Freddo + * Author: Freddo, Daniël H., johnb43 * When the confirm button is pressed. * * Arguments: @@ -14,40 +14,100 @@ * * Public: No */ + params ["_buttonOk"]; private _display = ctrlParent _buttonOk; -private _description = _display displayctrl IDC_INSERT_MARKER; +private _description = _display displayCtrl IDC_INSERT_MARKER; private _aceTimestamp = _display displayCtrl IDC_ACE_INSERT_MARKER_TIMESTAMP; -// handle timestamp +// Handle timestamp if (cbChecked _aceTimestamp && {ACE_player call FUNC(canTimestamp)}) then { - private _time = daytime; + // Determine marker timestamp based on time settings + private _time = switch (GVAR(timestampTimezone)) do { + case 1: { + systemTime select [3] + }; + case 2: { + systemTimeUTC params ["", "", "", "_hour", "_min", "_sec", "_msec"]; - // add timestamp suffix + private _hourOffset = round GVAR(timestampUTCOffset); + _hour = _hour + _hourOffset; + + // Add or subtract minutes offset based on the negative or positive timezone + if (GVAR(timestampUTCMinutesOffset) != 0) then { + _min = if (_hourOffset < 0) then { _min - GVAR(timestampUTCMinutesOffset) } else { _min + GVAR(timestampUTCMinutesOffset) }; + + // Add/remove extra hours from minutes + _hour = _hour + floor (_min / 60); + _min = (_min % 60 + 60) % 60; // ensure that minutes are between 0 and 59 (included) + }; + + [(_hour % 24 + 24) % 24, _min, _sec, _msec] // ensure that hours are between 0 and 23 (included) + }; + default { + private _daytime = dayTime; + + private _hour = floor _daytime; + private _min = floor ((_daytime - _hour) * 60); + private _sec = floor ((((_daytime - _hour) * 60) - _min) * 60); + private _msec = floor ((((((_daytime - _hour) * 60) - _min) * 60) - _sec) * 1000); + + [_hour, _min, _sec, _msec] + }; + }; + + _time params ["_hour", "_min", "_sec", "_msec"]; + + // Add timestamp suffix private _periodPostfix = ""; + if (GVAR(timestampHourFormat) == 12) then { - if (floor _time == 0) exitWith { - _time = _time + 12; + if (_hour == 0) exitWith { + _hour = _hour + 12; _periodPostfix = " am"; }; - if (floor _time == 12) exitWith { + if (_hour == 12) exitWith { _periodPostfix = " pm"; }; - if (_time < 12) then { + if (_hour < 12) then { _periodPostfix = " am"; } else { - _time = _time - 12; + _hour = _hour - 12; _periodPostfix = " pm"; }; }; + private _format = switch (GVAR(timestampFormat)) do { + case "HH": {"%1"}; + case "HH:MM": {"%1:%2"}; + case "HH:MM:SS": {"%1:%2:%3"}; + case "HH:MM:SS:MM": { // milliseconds are displayed as 0 to 59 + _msec = [_msec * 60 / 1000, 2] call CBA_fnc_formatNumber; + + "%1:%2:%3:%4" + }; + case "HH:MM:SS.mmm": { // milliseconds are displayed as 0 to 999 + _msec = [_msec, 3] call CBA_fnc_formatNumber; + + "%1:%2:%3.%4" + }; + }; + + _time = format [ + _format, + [_hour, 2] call CBA_fnc_formatNumber, + [_min, 2] call CBA_fnc_formatNumber, + [_sec, 2] call CBA_fnc_formatNumber, + _msec + ]; + _description ctrlSetText format [ "%1 [%2%3]", ctrlText _description, - [_time, GVAR(timestampFormat)] call BIS_fnc_timeToString, + _time, _periodPostfix ]; }; diff --git a/addons/markers/functions/fnc_onMouseButtonDown.sqf b/addons/markers/functions/fnc_onMouseButtonDown.sqf index ce4d637400..f0130c7c9d 100644 --- a/addons/markers/functions/fnc_onMouseButtonDown.sqf +++ b/addons/markers/functions/fnc_onMouseButtonDown.sqf @@ -37,5 +37,5 @@ if (_type == "marker" && {_marker find "_USER_DEFINED" != -1 && {_marker call FU GVAR(moving) = true; _marker setMarkerAlphaLocal 0.5; - [FUNC(movePFH), 0, [_marker, _ctrlMap, _originalPos, _originalAlpha]] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(movePFH), 0, [_marker, _ctrlMap, _originalPos, _originalAlpha]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index 8536b90a90..12dfe5de77 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -49,5 +49,4 @@ TRACE_2("params",_allMapMarkers,_allMapMarkersProperties); _x setMarkerDirLocal _dir; _x setMarkerSizeLocal [_scale, _scale]; }; - false -} count allMapMarkers; +} forEach allMapMarkers; diff --git a/addons/markers/initSettings.inc.sqf b/addons/markers/initSettings.inc.sqf index ce8e8e0473..65bf17e8b6 100644 --- a/addons/markers/initSettings.inc.sqf +++ b/addons/markers/initSettings.inc.sqf @@ -32,6 +32,37 @@ private _categoryName = format ["ACE %1", localize ELSTRING(map,Module_DisplayNa true ] call CBA_fnc_addSetting; +[ + QGVAR(timestampTimezone), "LIST", + [LSTRING(TimestampTimezone), LSTRING(TimestampTimezoneDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + [ + [0, 1, 2], + [LSTRING(TimestampTimezoneIngameTime), LSTRING(TimestampTimezoneSystemTime), LSTRING(TimestampTimezoneUTCTime)], + 0 + ], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(timestampUTCOffset), "SLIDER", + [LSTRING(TimestampUTCOffset), LSTRING(TimestampUTCOffsetDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + [-12, 14, 0, 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(TimestampUTCMinutesOffset), "LIST", + [LSTRING(TimestampUTCMinutesOffset), LSTRING(TimestampUTCMinutesOffsetDescription)], + [_categoryName, LLSTRING(Module_DisplayName)], + [ + [0, 15, 30, 45], + [0, 15, 30, 45], + 0 + ] +] call CBA_fnc_addSetting; + [ QGVAR(timestampHourFormat), "LIST", [LSTRING(TimestampHourFormat), LSTRING(TimestampHourFormatDescription)], @@ -48,7 +79,8 @@ private _formatDescription = [ LLSTRING(TimestampFormatDescription1), LLSTRING(TimestampFormatDescription2), LLSTRING(TimestampFormatDescription3), - LLSTRING(TimestampFormatDescription4) + LLSTRING(TimestampFormatDescription4), + LLSTRING(TimestampFormatDescription5) ] joinString endl; [ @@ -56,8 +88,8 @@ private _formatDescription = [ [LSTRING(timestampFormat), _formatDescription], [_categoryName, LLSTRING(Module_DisplayName)], [ - ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"], - ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM"], + ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM", "HH:MM:SS.mmm"], + ["HH", "HH:MM", "HH:MM:SS", "HH:MM:SS:MM", "HH:MM:SS.mmm"], 1 ] ] call CBA_fnc_addSetting; diff --git a/addons/markers/stringtable.xml b/addons/markers/stringtable.xml index f15394e3b5..a0c0be17f7 100644 --- a/addons/markers/stringtable.xml +++ b/addons/markers/stringtable.xml @@ -63,7 +63,7 @@ Allow moving markers for Erlaube Marker zu bewegen für - マーカー移動を許可するユーザー + マーカー移動を許可する対象 마커 이동 허가 誰可以移動標誌 谁可以移动标识 @@ -78,7 +78,7 @@ Restricts which players are able to move markers while holding the Alt key. Beschränkt welche Spieler Marker mit gedrückter Alt-Taste bewegen können. - どのプレイヤーが Alt キーを押しながらマーカー移動をできるか制限できます。 + Altキーを押しながらマーカー移動をできるプレイヤーを制限します。 Alt 키를 누른 상태에서 마커를 움직일 수 있는 플레이어를 제한합니다. 設定誰可以透過按住Alt鍵來移動標誌 设定谁可以透过按住 Alt 键来移动标识。 @@ -204,7 +204,7 @@ Whether to allow timestamps to be automatically applied to markers Автоматическое отображение времени, когда поставлена метка Active une interface permettant d'apposer un horodatage sur les marqueurs. - マーカーへ自動的にタイムスタンプを付与するかどうかを設定できます。 + タイムスタンプをマーカーに自動的に適用することを許可するかどうか Permitir que las marcas de tiempo sean automáticamente aplicadas a los marcadores Zezwól na automatyczne stosowanie znaczników czasu do markerów Ob Zeitstempel automatisch auf Maker angewendet werden sollen. @@ -230,7 +230,7 @@ Watch Required Необходимы часы Une montre est requise. - 時計の要求 + 時計が必要 Reloj requerido Wymagany zegarek Uhr benötigt @@ -239,6 +239,114 @@ 시계 필요함 Relógio necessário + + Time Zone + Часовой пояс + Fuseau horaire + タイムゾーン + Zona horaria + Strefa czasowa + Zeitzone + Fuso orario + 时区 + 시간대 + + + Changes the time zone for the timestamp + Измените часовой пояс для метки времени + Modifiez le fuseau horaire pour l'horodatage + タイムスタンプのタイムゾーンを変更します + Cambie la zona horaria para la marca de tiempo + Zmień strefę czasową dla znaczników czasu + Ändern Sie die Zeitzone für den Zeitstempel + Modifica il fuso orario per la marca temporale + 更改时间戳的时区 + 타임스탬프의 시간대를 변경하십시오 + + + In-game Time + Время в игре + Heure de jeu + ゲーム内時間 + Hora del juego + Czas gry + Ingame-Zeit + Ora del gioco + 游戏内时间 + 게임 시간 + + + System Time + Системное время + Heure système + システム時間 + Hora del sistema + Czas systemowy + Systemzeit + Ora del sistema + 系统时间 + 시스템 시간 + + + UTC Time + Время UTC + Heure UTC + UTC時間 + Hora UTC + Czas UTC + UTC-Zeit + Tempo-UTC + UTC时间 + UTC 시간 + + + UTC Offset + Смещение UTC + Décalage UTC + UTCオフセット + Desplazamiento UTC + Przesunięcie UTC + UTC-Verschiebung + Deviazione-UTC + UTC偏移量 + UTC 오프셋 + + + Changes the time offset for the UTC timestamp + Измените смещение времени для метки времени UTC + Modifier le décalage horaire pour l'horodatage UTC + UTCタイムスタンプの時オフセットを変更します + Cambiar el desplazamiento horario para la marca de tiempo UTC + Zmień przesunięcie czasu dla sygnatury czasowej UTC + Ändere die Zeitverschiebung für den UTC-Zeitstempel + Modifica la deviazione della marca temporale UTC. + 更改UTC时间戳的时间偏移量 + UTC 타임 스탬프의 시간 오프셋을 변경하십시오 + + + UTC Minutes Offset + UTC Минутное смещение + Décalage des minutes UTC + UTC分オフセット + Desplazamiento de minutos UTC + Przesunięcie minut UTC + UTC-Minutenversatz + Deviazione Minuti UTC + UTC分钟偏移量 + UTC 분 오프셋 + + + Change the minute offset for the UTC timestamp + Изменить минутное смещение для времени UTC + Modifier le décalage des minutes pour l'horodatage UTC + UTCタイムスタンプの分オフセットを変更します + Cambiar el desplazamiento de minutos para la marca de tiempo UTC + Zmień przesunięcie minut dla sygnatury czasowej UTC + Ändere den Minutenversatz für den UTC-Zeitstempel + Modifica la deviazione dei minuti della marca temporale UTC. + 更改UTC时间戳的分钟偏移量 + UTC 타임 스탬프의 분 오프셋을 변경하십시오 + Timestamp Format Формат времени @@ -269,7 +377,7 @@ "HH" - Hour "ЧЧ" - Час "HH" - Heures - "HH" - 時間 + "HH" - 時 "HH" - Hora "HH" - Godziny "HH" - Stunden @@ -305,17 +413,24 @@ SS - Segundos - "MM" - Milliseconds - "МС" - Миллисекунда - "MM" - Millisecondes - "MM" - ミリ秒 - "MM" - Milisegundos - "MM" - Milisekundy - "MS" - Milisekunden - "MS" - Millisecondi - "MS"—毫秒 - "MS" - 밀리초 - MM - Milisegundos + "MM" - Milliseconds (from 0 to 59) + "MM" - Millisecondes (de 0 à 59) + "MS" - Milisekunden (von 0 bis 59) + "MS" - Millisecondi (da 0 a 59) + "MS" - Milissegundos (de 0 a 59) + "MS" - 밀리초 (0부터 59까지) + "MM" - ミリ秒 (0から59) + "ММ" - миллисекунды (от 0 до 59) + + + "mmm" - Milliseconds (from 0 to 999) + "mmm" - Millisecondes (de 0 à 999) + "mmm" - Milisekunden (von 0 bis 999) + "mmm" - Millisecondi (da 0 a 999) + "mmm" - Milissegundos (de 0 a 999) + "mmm" - 밀리초 (0부터 999까지) + "mmm" - ミリ秒 (0から599) + "ммм" - миллисекунды (от 0 до 999) Timestamp Hour Format @@ -334,7 +449,7 @@ 24-Hour Clock 24 часовой формат Format 24 heures - 24 時間表記 + 24時間表記 Reloj 24-Horas Zegar 24-godzinny 24-Stunden @@ -347,7 +462,7 @@ 12-Hour Clock 12 часовой формат Format 12 heures - 12 時間表記 + 12時間表記 Reloj 12-Horas Zegar 12-godzinny 12-Stunden @@ -360,7 +475,7 @@ Changes timestamp to use either 24-hour or 12-hour clock format Изменяет формат времени на маркере на 24 часовой, либо 12 часовой Permet de choisir le système d'horodatage souhaité, au format 12 ou 24 heures. - タイムスタンプの時刻を 24 時間か 12 時間表記のどちらかに変更できます。 + タイムスタンプの時刻を24時間表記か12時間表記かのどちらかに変更します Cambia que la marca de tiempo sea en formato de reloj 24-horas o 12-horas Zmienia znacznik czasu tak, aby używał formatu 24-godzinnego lub 12-godzinnego Ändert den Zeitstempel, um entweder das 24-Stunden- oder das 12-Stunden-Format zu verwenden diff --git a/addons/maverick/config.cpp b/addons/maverick/config.cpp index 6d5837f87d..d25878d004 100644 --- a/addons/maverick/config.cpp +++ b/addons/maverick/config.cpp @@ -9,10 +9,6 @@ class CfgPatches { authors[] = {"xrufix"}; url = ECSTRING(main,URL); VERSION_CONFIG; - ammo[] = { - QGVAR(L), - "ace_kh25ml" - }; magazines[] = { QGVAR(L_magazine_x1), QGVAR(L_pylonmissile_x1), diff --git a/addons/medical/dev/watchVariable.sqf b/addons/medical/dev/watchVariable.sqf index 0eb191e8dd..05cb094ba8 100644 --- a/addons/medical/dev/watchVariable.sqf +++ b/addons/medical/dev/watchVariable.sqf @@ -28,7 +28,7 @@ GVAR(dev_watchVariableRunning) = true; _return pushBack format ["State: %2", _color, _targetState]; private _hasStableVitals = ["N", "Y"] select ([_unit] call EFUNC(medical_status,hasStableVitals)); private _hasStableCondition = ["N", "Y"] select ([_unit] call EFUNC(medical_status,isInStableCondition)); - private _unconcFlag = if IS_UNCONSCIOUS(_unit) then {"[U]"} else {""}; + private _unconcFlag = ["", "[U]"] select IS_UNCONSCIOUS(_unit); private _timeLeft = _unit getVariable [QEGVAR(medical_statemachine,cardiacArrestTimeLeft), -1]; private _cardiactArrestFlag = if IN_CRDC_ARRST(_unit) then {format ["[CA %1]", _timeLeft toFixed 1]} else {""}; _return pushBack format ["[StableVitals: %1] [StableCon: %2] %3 %4", _hasStableVitals, _hasStableCondition, _unconcFlag, _cardiactArrestFlag]; @@ -38,7 +38,7 @@ GVAR(dev_watchVariableRunning) = true; private _woundBleeding = GET_WOUND_BLEEDING(_unit); private _bloodLoss = GET_BLOOD_LOSS(_unit); private _hemorrhage = GET_HEMORRHAGE(_unit); - private _isBleeding = if (IS_BLEEDING(_unit)) then {"Bleeding"} else {""}; + private _isBleeding = ["", "[Bleeding]"] select IS_BLEEDING(_unit); private _secondsToHeartstop = if (_bloodLoss != 0) then {format ["[Time Left: %1 sec]", (((_bloodVolume - BLOOD_VOLUME_CLASS_4_HEMORRHAGE) max 0) / _bloodLoss) toFixed 0]} else {""}; _return pushBack format ["Blood: %1 [Hemorrhage: %2] %3", _bloodVolume toFixed 3, _hemorrhage, _isBleeding]; _return pushBack format [" - [W: %1 T: %2] %3", _woundBleeding toFixed 4, _bloodLoss toFixed 4, _secondsToHeartstop]; @@ -60,7 +60,7 @@ GVAR(dev_watchVariableRunning) = true; // Damage: private _damage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; - private _limping = if (_unit getVariable [QEGVAR(medical,isLimping), false]) then {"[ Limping ]"} else {""}; + private _limping = ["", "[ Limping ]"] select (_unit getVariable [QEGVAR(medical,isLimping), false]); _return pushBack format ["BodyPartDamage: [H: %1] [B: %2]", (_damage select 0) toFixed 2, (_damage select 1) toFixed 2]; _return pushBack format ["[LA:%1] [RA: %2] [LL:%3] [RL: %4]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2]; @@ -68,8 +68,8 @@ GVAR(dev_watchVariableRunning) = true; _return pushBack format ["[HHnd:%1] [HLeg: %2] %3", (_unit getHitPointDamage "HitHands") toFixed 2, (_unit getHitPointDamage "HitLegs") toFixed 2, _limping]; private _fractures = GET_FRACTURES(_unit); - private _canSprint = if (isSprintAllowed _unit) then {""} else {"[Sprint Blocked]"}; - private _forceWalk = if (isForcedWalk _unit) then {"[Forced Walking]"} else {""}; + private _canSprint = ["[Sprint Blocked]", ""] select (isSprintAllowed _unit); + private _forceWalk = ["", "[Forced Walking]"] select (isForcedWalk _unit); _return pushBack format ["Fractures: %1 %2%3", _fractures, _canSprint, _forceWalk]; diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index 23ac9f0990..e490399c4b 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -34,15 +34,15 @@ params [ ]; TRACE_7("addDamageToUnit",_unit,_damageToAdd,_bodyPart,_typeOfDamage,_instigator,_damageSelectionArray,_overrideInvuln); -_bodyPart = toLower _bodyPart; +_bodyPart = toLowerANSI _bodyPart; private _bodyPartIndex = ALL_BODY_PARTS find _bodyPart; if (_bodyPartIndex < 0) then { _bodyPartIndex = ALL_SELECTIONS find _bodyPart; }; // 2nd attempt with selection names ("hand_l", "hand_r", "leg_l", "leg_r") -if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1", _this); false}; -if (isNull _unit || {!local _unit} || {!alive _unit}) exitWith {ERROR_2("addDamageToUnit - badUnit %1 [local %2]", _this, local _unit); false}; -if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1", _this); false}; +if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1",_this); false}; +if (isNull _unit || {!local _unit} || {!alive _unit}) exitWith {ERROR_2("addDamageToUnit - badUnit %1 [local %2]",_this,local _unit); false}; +if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1",_this); false}; if (!_overrideInvuln && {!((isDamageAllowed _unit) && {_unit getVariable [QEGVAR(medical,allowDamage), true]})}) exitWith { - ERROR_1("addDamageToUnit - unit invulnerable %1", _this); false + ERROR_1("addDamageToUnit - unit invulnerable %1",_this); false }; // Extension is case sensitive and expects this format (different from ALL_BODY_PARTS) @@ -69,7 +69,7 @@ private _selectionSpecific = true; if (isClass _config) then { _selectionSpecific = (getNumber (_config >> "selectionSpecific")) == 1; } else { - WARNING_2("Damage type not in config [%1:%2]", _typeOfDamage, _config); + WARNING_2("Damage type not in config [%1:%2]",_typeOfDamage,_config); }; INFO_4("Debug AddDamageToUnit: Type [%1] - Selection Specific [%2] - HitPoint [%3 -> %4]",_typeOfDamage,_selectionSpecific,_startDmg select _bodyPartIndex,_endDmg select _bodyPartIndex); INFO_4("Pain Change [%1 -> %2] - BodyPartDamage Change [%3 -> %4]",_startPain,_endPain,_startDmg,_endDmg); diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index cf078ae64b..a1de71c36b 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -38,7 +38,7 @@ if (!local _unit) exitWith { }; if (_knockOut isEqualTo IS_UNCONSCIOUS(_unit)) exitWith { - WARNING_2("setUnconscious called with no change [Unit %1] [State [%2]", _unit, _knockOut); + WARNING_2("setUnconscious called with no change [Unit %1] [State [%2]",_unit,_knockOut); false }; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index cfc05e4d75..6a081fa648 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -37,7 +37,7 @@ Unconscious Wake Up Chance Wahrscheinlichkeit um aufzuwachen - 気絶時の覚醒確率 + 無意識状態時の覚醒確率 Шанс очнуться при потере сознания Chance de reprendre connaissance Chance de recuperar consciência @@ -84,7 +84,7 @@ When an unconscious patient has Epinephrine in their system, the time between spontaneous wake up checks is divided by this value. - 気絶した患者の体内に投与されたアドレナリンがある場合、 覚醒確率計算の実施間隔が値で除算されます。 + 無意識状態の患者の体内に投与されたアドレナリンがある場合、 覚醒確率計算の実施間隔が値で除算されます。 增加因病患的循環系統裡面的腎上腺素自我甦醒的機率。 增加因病患的循环系统里面的肾上腺素自我苏醒的机率。 Augmente la fréquence des tests de réveil lorsque le patient a de l'épinéphrine dans son système sanguin.\n(L'épinéphrine n'accélère pas la reprise de conscience si la valeur est définie sur 1.) diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index c53cb78934..0b225c7f0b 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" ["CBA_settingsInitialized", { - TRACE_1("settingsInitialized", GVAR(enabledFor)); + TRACE_1("settingsInitialized",GVAR(enabledFor)); if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients diff --git a/addons/medical_ai/XEH_preStart.sqf b/addons/medical_ai/XEH_preStart.sqf index 52e3374924..b4d795cbbf 100644 --- a/addons/medical_ai/XEH_preStart.sqf +++ b/addons/medical_ai/XEH_preStart.sqf @@ -13,7 +13,7 @@ private _itemHash = createHashMap; private _items = getArray (configFile >> "ace_medical_treatment_actions" >> _x >> "items"); if (_items isEqualTo []) then { ERROR_1("bad action %1",_x); }; private _itemClassname = configName (configFile >> "CfgWeapons" >> _items # 0); - private _treatment = if ((count _treatments) > 1) then { _x } else { "" }; + private _treatment = ["", _x] select ((count _treatments) > 1); _typeHash set [_itemClassname, _treatment]; } forEach _treatments; _itemHash set [_itemType, _typeHash]; diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index f412a718d8..b8e77aab43 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -19,7 +19,7 @@ params ["_unit", "_actionName", "_isSelfTreatment"]; TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment); -if (vehicle _unit != _unit) exitWith {}; +if (!isNull objectParent _unit) exitWith {}; private _configProperty = "animationMedic"; if (_isSelfTreatment) then { diff --git a/addons/medical_ai/stringtable.xml b/addons/medical_ai/stringtable.xml index 61cebf9fb5..5081a09d96 100644 --- a/addons/medical_ai/stringtable.xml +++ b/addons/medical_ai/stringtable.xml @@ -20,7 +20,7 @@ AI will respond to injury and unconsciousness KI reagiert auf Verletzungen und Bewusstlosigkeit - AIが負傷者と気絶している人に対して行動するようになります。 + AIが負傷者と無意識状態の人に対して行動するようになります。 ИИ будет реагировать на травмы и потерю сознания Les unités IA seront sensibles aux blessures, ainsi qu'à la perte de connaissance. A IA irá responder a ferimentos e perdas de consciência @@ -57,6 +57,7 @@ Items requis Exigir Itens アイテムを要求 + Требуемые предметы AI will only perform medical treatment if they have the necessary items in their inventory. @@ -67,6 +68,7 @@ Les IA n'effectueront un traitement médical que si elles ont le matériel nécessaire dans leur inventaire. A IA só irá realizar tratamento médico se tiver os itens necessários em seu inventário. AIのインベントリに必要なアイテムがある場合にのみ治療を実行します。 + Искусственный интеллект будет оказывать медицинскую помощь только в том случае, если в его инвентаре есть необходимые предметы. Auto Convert Items for AI @@ -77,6 +79,7 @@ Conversione automatica di risorse mediche per IA Conversão automática de itens para IA AIのアイテムを自動変換 + Автоматическое преобразование элементов для ИИ diff --git a/addons/medical_blood/XEH_postInit.sqf b/addons/medical_blood/XEH_postInit.sqf index 9ef55adf0e..daf4595584 100644 --- a/addons/medical_blood/XEH_postInit.sqf +++ b/addons/medical_blood/XEH_postInit.sqf @@ -3,7 +3,7 @@ GVAR(useAceMedical) = ["ace_medical"] call EFUNC(common,isModLoaded); // To support public API regardless of component settings -[QGVAR(spurt), FUNC(spurt)] call CBA_fnc_addEventHandler; +[QGVAR(spurt), LINKFUNC(spurt)] call CBA_fnc_addEventHandler; if (isServer) then { GVAR(bloodDrops) = []; @@ -21,7 +21,7 @@ if (isServer) then { // Start the cleanup loop if (_index == 0) then { - [FUNC(cleanupLoop), [], GVAR(bloodLifetime)] call CBA_fnc_waitAndExecute; + [LINKFUNC(cleanupLoop), [], GVAR(bloodLifetime)] call CBA_fnc_waitAndExecute; }; }] call CBA_fnc_addEventHandler; }; diff --git a/addons/medical_blood/functions/fnc_handleWoundReceived.sqf b/addons/medical_blood/functions/fnc_handleWoundReceived.sqf index 8dfc9c650b..8b46233af2 100644 --- a/addons/medical_blood/functions/fnc_handleWoundReceived.sqf +++ b/addons/medical_blood/functions/fnc_handleWoundReceived.sqf @@ -28,7 +28,7 @@ if (_damageType in GVAR(noBloodDamageTypes)) exitWith {}; if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {}; // Don't bleed on the ground if in a vehicle -if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; +if (!isNull objectParent _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; private _bulletDir = if (isNull _shooter) then { random 360 // Cannot calculate the direction properly, pick a random direction diff --git a/addons/medical_blood/functions/fnc_init.sqf b/addons/medical_blood/functions/fnc_init.sqf index 86c0c668c1..6392a6e451 100644 --- a/addons/medical_blood/functions/fnc_init.sqf +++ b/addons/medical_blood/functions/fnc_init.sqf @@ -60,6 +60,6 @@ private _listCode = if (_mode == BLOOD_ONLY_PLAYERS) then { GVAR(stateMachine) = [_listCode, true] call CBA_statemachine_fnc_create; [GVAR(stateMachine), LINKFUNC(onBleeding), {}, {}, "Bleeding"] call CBA_statemachine_fnc_addState; -GVAR(woundReceivedEH) = [QEGVAR(medical,woundReceived), FUNC(handleWoundReceived)] call CBA_fnc_addEventHandler; +GVAR(woundReceivedEH) = [QEGVAR(medical,woundReceived), LINKFUNC(handleWoundReceived)] call CBA_fnc_addEventHandler; TRACE_3("Set up state machine and wounds event",_mode,GVAR(stateMachine),GVAR(woundReceivedEH)); diff --git a/addons/medical_blood/functions/fnc_onBleeding.sqf b/addons/medical_blood/functions/fnc_onBleeding.sqf index 63ceb3bd29..02ddd93fd0 100644 --- a/addons/medical_blood/functions/fnc_onBleeding.sqf +++ b/addons/medical_blood/functions/fnc_onBleeding.sqf @@ -22,7 +22,7 @@ params ["_unit"]; if !(_unit call FUNC(isBleeding)) exitWith {}; // Don't bleed on the ground if in a vehicle -if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; +if (!isNull objectParent _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; if (CBA_missionTime > (_unit getVariable [QGVAR(nextTime), -10])) then { private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6; diff --git a/addons/medical_blood/stringtable.xml b/addons/medical_blood/stringtable.xml index 6c3be0c557..a63de99ea0 100644 --- a/addons/medical_blood/stringtable.xml +++ b/addons/medical_blood/stringtable.xml @@ -99,7 +99,7 @@ Controls the lifetime of blood drop objects. - 血痕オブジェクトの寿命を決定します。 + 血痕オブジェクトの寿命を制御します。 Définit la durée d'affichage des traces de sang. Управляет временем жизни объектов капель крови. Controla o tempo de vida que um objeto de gota de sangue tem. diff --git a/addons/medical_damage/functions/fnc_interpolatePoints.sqf b/addons/medical_damage/functions/fnc_interpolatePoints.sqf index a84f079f30..b343417837 100644 --- a/addons/medical_damage/functions/fnc_interpolatePoints.sqf +++ b/addons/medical_damage/functions/fnc_interpolatePoints.sqf @@ -19,7 +19,7 @@ */ params ["_input", "_points", ["_randomRound", false]]; -if (count _points < 1) exitWith { +if (_points isEqualTo []) exitWith { //TODO: sensible default/error value 0 }; diff --git a/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf b/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf index f2441b3704..4dfcbe840a 100644 --- a/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical_damage/functions/fnc_parseConfigForInjuries.sqf @@ -38,7 +38,7 @@ private _classID = 0; private _details = [_selections, _bleeding, _pain, _causeLimping, _causeFracture]; GVAR(woundDetails) set [_className, _details]; GVAR(woundDetails) set [_classID, _details]; - + GVAR(woundClassNames) pushBack _className; { GVAR(woundClassNamesComplex) set [10 * _classID + _forEachIndex, format ["%1%2", _className, _x]]; @@ -61,7 +61,7 @@ if (isClass (_damageTypesConfig >> "woundHandlers")) then { _defaultWoundHandlers = [_damageTypesConfig >> "woundHandlers"] call FUNC(parseWoundHandlersCfg); reverse _defaultWoundHandlers; }; -TRACE_1("Found default wound handlers", count _defaultWoundHandlers); +TRACE_1("Found default wound handlers",count _defaultWoundHandlers); // Collect all available damage types from the config { @@ -77,15 +77,15 @@ TRACE_1("Found default wound handlers", count _defaultWoundHandlers); private _thresholds = GET_ARRAY(_damageTypeSubClassConfig >> "thresholds",_thresholdsDefault); private _selectionSpecific = GET_NUMBER(_damageTypeSubClassConfig >> "selectionSpecific",_selectionSpecificDefault); - + private _woundHandlers = []; if (isClass (_damageTypeSubClassConfig >> "woundHandlers")) then { _woundHandlers = [_damageTypeSubClassConfig >> "woundHandlers"] call FUNC(parseWoundHandlersCfg); reverse _woundHandlers; - TRACE_2("Damage type found wound handlers", _className, count _woundHandlers); + TRACE_2("Damage type found wound handlers",_className,count _woundHandlers); } else { _woundHandlers = _defaultWoundHandlers; - TRACE_1("Damage type has no wound handlers, using default", _className); + TRACE_1("Damage type has no wound handlers, using default",_className); }; /* @@ -115,11 +115,11 @@ TRACE_1("Found default wound handlers", count _defaultWoundHandlers); if (_woundType == "woundHandlers") then {continue}; if (_woundType in GVAR(woundDetails)) then { private _weighting = GET_ARRAY(_x >> "weighting",[[ARR_2(0,1)]]); - private _dmgMulti = GET_NUMBER(_x >> "damageMultiplier", 1); - private _bleedMulti = GET_NUMBER(_x >> "bleedingMultiplier", 1); - private _sizeMulti = GET_NUMBER(_x >> "sizeMultiplier", 1); - private _painMulti = GET_NUMBER(_x >> "painMultiplier", 1); - private _fractureMulti = GET_NUMBER(_x >> "fractureMultiplier", 1); + private _dmgMulti = GET_NUMBER(_x >> "damageMultiplier",1); + private _bleedMulti = GET_NUMBER(_x >> "bleedingMultiplier",1); + private _sizeMulti = GET_NUMBER(_x >> "sizeMultiplier",1); + private _painMulti = GET_NUMBER(_x >> "painMultiplier",1); + private _fractureMulti = GET_NUMBER(_x >> "fractureMultiplier",1); _damageWoundDetails pushBack [_woundType, _weighting, _dmgMulti, _bleedMulti, _sizeMulti, _painMulti, _fractureMulti]; } else { WARNING_2("Damage type %1 refers to wound %2, but it doesn't exist: skipping.",_className,configName _x); diff --git a/addons/medical_damage/functions/fnc_woundReceived.sqf b/addons/medical_damage/functions/fnc_woundReceived.sqf index 52dbcba265..a7e3861dee 100644 --- a/addons/medical_damage/functions/fnc_woundReceived.sqf +++ b/addons/medical_damage/functions/fnc_woundReceived.sqf @@ -22,14 +22,13 @@ params ["_unit", "_allDamages", "_shooter", "_ammo"]; private _typeOfDamage = _ammo call FUNC(getTypeOfDamage); if (_typeOfDamage in GVAR(damageTypeDetails)) then { (GVAR(damageTypeDetails) get _typeOfDamage) params ["", "", "_woundHandlers"]; - + private _damageData = [_unit, _allDamages, _typeOfDamage]; { _damageData = _damageData call _x; - TRACE_1("Wound handler returned", _damageData); + TRACE_1("Wound handler returned",_damageData); if !(_damageData isEqualType [] && {(count _damageData) >= 3}) exitWith { - TRACE_1("Return invalid, terminating wound handling", _damageData); + TRACE_1("Return invalid, terminating wound handling",_damageData); }; } forEach _woundHandlers; - }; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf index 5df29c7702..fb82f383b6 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf @@ -41,7 +41,7 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra // process wounds separately for each body part hit { // forEach _allDamages _x params ["_damage", "_bodyPart"]; - _bodyPart = toLower _bodyPart; + _bodyPart = toLowerANSI _bodyPart; // silently ignore structural damage if (_bodyPart == "#structural") then {continue}; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf b/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf index 64ac637107..9aaaf4a382 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf @@ -24,5 +24,5 @@ private _newDamages = _allDamages apply { [_x select 0, selectRandom ALL_BODY_PARTS, _x select 2]; }; -TRACE_1("Vehicle crash handled, passing damage", _newDamages); +TRACE_1("Vehicle crash handled, passing damage",_newDamages); [_unit, _newDamages, _typeOfDamage] //return diff --git a/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf b/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf index 5f4bd35941..8f9af8262c 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerVehiclehit.sqf @@ -42,5 +42,5 @@ private _newDamages = []; _newDamages pushBack [_damageMap get _x, _x, _damageToApply]; } forEach (keys _damageMap); // micro-optimization again, two 'get's is still faster than iterating over a hashmap -TRACE_1("Vehicle explosion handled, passing damage", _newDamages); +TRACE_1("Vehicle explosion handled, passing damage",_newDamages); [_unit, _newDamages, _typeOfDamage] //return diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml index 63d10dcd35..626826117d 100644 --- a/addons/medical_damage/stringtable.xml +++ b/addons/medical_damage/stringtable.xml @@ -18,9 +18,9 @@ Sets the amount of damage a player can receive before going unconscious (and dying if "Sum of Trauma" is enabled). - プレイヤーが気絶するまでに受けられるダメージ量を設定します。\n("外傷の合計"が有効な場合は死亡するまでに受けられるダメージ量) + プレイヤーが無意識状態に陥るまでに受けられるダメージ量を設定します。\n("外傷の合計"が有効な場合は死亡するまでに受けられるダメージ量) Définit la quantité de dégâts qu'un joueur peut subir avant de perdre connaissance (ou mourir, si l'option "Somme des traumatismes" est sélectionnée). - Устанавливает количество урона, которое может получить игрок, прежде чем потеряет сознание. + Устанавливает количество урона, которое может получить игрок, прежде чем потеряет сознание (и умирает, если включена функция "Сумма травм"). Define a quantidade de dano que um jogador pode receber antes de ficar inconsciente. 設定玩家在無意識前能承受多少傷害。 设置玩家在昏迷前可以承受的伤害量(如果启用了“创伤总和”,则会死亡)。 @@ -49,9 +49,9 @@ Sets the amount of damage an AI unit can receive before going unconscious (or dying when "Sum of Trauma" is enabled). - AIが気絶するまでに受けられるダメージ量を設定します。\n("外傷の合計"が有効な場合は死亡するまでに受けられるダメージ量) + AIが無意識状態に陥るまでに受けられるダメージ量を設定します。\n("外傷の合計"が有効な場合は死亡するまでに受けられるダメージ量) Définit la quantité de dégâts qu'une unité IA peut subir avant de perdre connaissance (ou mourir, si l'option "Somme des traumatismes" est sélectionnée). - Устанавливает количество урона, которое может получить ИИ, прежде чем потеряет сознание. + Устанавливает количество урона, которое может получить ИИ, прежде чем потеряет сознание (или умирает, когда включена функция "Сумма травм").. Define a quantidade de dano que uma IA pode receber antes de ficar inconsciente. 設定AI在無意識之前能承受多少傷害 设置 AI 在昏迷前可以承受的伤害量(如果启用了“创伤总和”,则会死亡)。 @@ -625,7 +625,7 @@ Determines what damage can be fatal Определяет какой урон будет смертельным - 致命となるダメージの種類を決定します。 + 致命となるダメージの種類を定義します。 決定何種傷害為致命 确定哪些伤害可能是致命的 Determina quali danni possono essere letali @@ -757,7 +757,7 @@ Legt die Höhe des Schadens fest, den eine Einheit erhalten kann, bevor diese ohnmächtig wird. (0 für Misionsnormalwert) Determina il livello di danni sopportabili da un'unità senza svenire. (0 per il valore predefinito dalla missione) Définit la quantité de dégâts que l'unité peut subir avant de perdre connaissance (ou mourir, si l'option "Somme des traumatismes" est sélectionnée).\n(0 utilise la valeur définie dans la mission.) - このユニットが気絶するまでに受けられるダメージ量を設定します。 (ミッション標準は0) + このユニットが無意識状態に陥るまでに受けられるダメージ量を設定します。 (ミッション標準は0) Určuje kolik poškození může jednotka utrpět než upadne do bezvědomí. (pro použití standardní hodnoty mise zadejte 0) Устанавливает количество урона, которое может получить юнит перед тем, как потерять сознание. (0 для значения миссии) Ustawia próg obrażeń jakie może otrzymać jednostka przed utratą przytomności. (0 jako ustawienie domyślne misji) @@ -772,7 +772,7 @@ Шанс потерять сознание от боли Szansa na nieprzytomność przez ból Probabilità Svenimento da Dolore - 痛みによる気絶確率 + 痛みによる無意識化確率 Probabilidad de inconsciencia por dolor Douleur - Chance d'évanouissement Chance für Bewusslosigkeit durch Schmerz @@ -785,7 +785,7 @@ Шанс, что человек потеряет сознание, когда его боль выше допустимого порога при получении травмы. La probabilità che un'unità perda i sensi quando il suo dolore è sopra la soglia critica ricevendo danni. Szansa że osoba straci przytomność gdy jej ból jest powyżej tolerowalnego progu podczas otrzymywania obrażeń. - ユニットがダメージを受けた時の痛みが許容しきい値を超えていた場合に気絶する確率を設定します。 + ユニットがダメージを受けた時の痛みが許容しきい値を超えていた場合に無意識状態に陥る確率を設定します。 La probabilidad de que una persona caiga inconsciente cuando su dolor está por encima del umbral al haber recibido daño. La probabilité pour qu'une personne perde connaissance lorsque la douleur ressentie est supérieure à son seuil de tolérance. Die Wahrscheinlichkeit, dass eine Person bewusstlos wird, wenn ihre Schmerzen bei einer Verwundung über der Toleranzschwelle liegen. @@ -798,7 +798,7 @@ Порог боли для потери сознания Soglia Critica di Dolore Seuil d'inconscience par la douleur. - 気絶する痛みのしきい値 + 無意識状態に陥る痛みのしきい値 Próg Nieprzytomności od Bólu Schmerz-Bewusstlosigkeit-Grenze 고통 기절 한계점 diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index 6455904f95..2514c62254 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -13,12 +13,11 @@ // Check if last hit point is our dummy. private _allHitPoints = getAllHitPointsDamage _unit param [0, []]; reverse _allHitPoints; - while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1", _allHitPoints deleteAt 0); }; + while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1",_allHitPoints deleteAt 0); }; if (_allHitPoints param [0, ""] != "ACE_HDBracket") then { - private _config = configOf _unit; - if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; - if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; + if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; + if (getNumber ((configOf _unit) >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; ERROR_1("Bad hitpoints for unit type ""%1""",typeOf _unit); } else { // Calling this function inside curly brackets allows the usage of @@ -33,7 +32,7 @@ #ifdef DEBUG_MODE_FULL [QEGVAR(medical,woundReceived), { params ["_unit", "_damages", "_shooter", "_ammo"]; - TRACE_4("wound",_unit,_damages, _shooter, _ammo); + TRACE_4("wound",_unit,_damages,_shooter,_ammo); //systemChat str _this; }] call CBA_fnc_addEventHandler; #endif diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index dab2e7efe3..b0304f167f 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -19,6 +19,7 @@ if (isNil QUOTE(BLOOD_LOSS_KNOCK_OUT_THRESHOLD)) then {BLOOD_LOSS_KNOCK_OUT_THRE if (isNil QUOTE(PAIN_FADE_TIME)) then {PAIN_FADE_TIME = PAIN_FADE_TIME_DEFAULT}; if (isNil QUOTE(LIMPING_DAMAGE_THRESHOLD)) then {LIMPING_DAMAGE_THRESHOLD = LIMPING_DAMAGE_THRESHOLD_DEFAULT}; if (isNil QUOTE(FRACTURE_DAMAGE_THRESHOLD)) then {FRACTURE_DAMAGE_THRESHOLD = FRACTURE_DAMAGE_THRESHOLD_DEFAULT}; +if (isNil QUOTE(CARDIAC_OUTPUT_MIN)) then {CARDIAC_OUTPUT_MIN = CARDIAC_OUTPUT_MIN_DEFAULT}; // Derive the alternate fatal damage coefficents if (isNil QUOTE(FATAL_SUM_DAMAGE_WEIBULL_K) || isNil QUOTE(FATAL_SUM_DAMAGE_WEIBULL_L)) then { private _x1 = 0.5; diff --git a/addons/medical_engine/functions/fnc_damageBodyPart.sqf b/addons/medical_engine/functions/fnc_damageBodyPart.sqf index c25d83c46c..f69bce2cae 100644 --- a/addons/medical_engine/functions/fnc_damageBodyPart.sqf +++ b/addons/medical_engine/functions/fnc_damageBodyPart.sqf @@ -28,7 +28,7 @@ TRACE_3("damageBodyPart",_unit,_selection,_damage); _damage = [0, DAMAGED_MIN_THRESHOLD] select _damage; -switch (toLower _selection) do { +switch (toLowerANSI _selection) do { case ("head"): { _unit setHitPointDamage ["HitHead", _damage]; }; diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 8db9950a86..a60816222f 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -32,6 +32,11 @@ if (_hitPoint isEqualTo "") then { if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {_oldDamage}; private _newDamage = _damage - _oldDamage; + +// Happens occasionally for vehiclehit events (see line 80 onwards) +// Just exit early to save some frametime +if (_newDamage == 0 && {_hitpoint isNotEqualTo "ace_hdbracket"}) exitWith {_oldDamage}; + // Get scaled armor value of hitpoint and calculate damage before armor // We scale using passThrough to handle explosive-resistant armor properly (#9063) // We need realDamage to determine which limb was hit correctly @@ -85,8 +90,8 @@ if ( {_ammo isNotEqualTo ""} && { private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; - GET_NUMBER(_ammoCfg >> "explosive", 0) > 0 || - {GET_NUMBER(_ammoCfg >> "indirectHit", 0) > 0} + GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || + {GET_NUMBER(_ammoCfg >> "indirectHit",0) > 0} } ) exitwith { TRACE_5("Vehicle hit",_unit,_shooter,_instigator,_damage,_newDamage); diff --git a/addons/medical_engine/functions/fnc_setUnconsciousAnim.sqf b/addons/medical_engine/functions/fnc_setUnconsciousAnim.sqf index 531f5d4062..4ed63253c7 100644 --- a/addons/medical_engine/functions/fnc_setUnconsciousAnim.sqf +++ b/addons/medical_engine/functions/fnc_setUnconsciousAnim.sqf @@ -33,14 +33,14 @@ if (_isUnconscious) then { }; // set animation inside vehicles - if (vehicle _unit != _unit) then { + if (!isNull objectParent _unit) then { private _unconAnim = _unit call EFUNC(common,getDeathAnim); TRACE_2("inVehicle - playing death anim",_unit,_unconAnim); [_unit, _unconAnim] call EFUNC(common,doAnimation); }; } else { // reset animation inside vehicles - if (vehicle _unit != _unit) then { + if (!isNull objectParent _unit) then { private _awakeAnim = _unit call EFUNC(common,getAwakeAnim); TRACE_2("inVehicle - playing awake anim",_unit,_awakeAnim); [_unit, _awakeAnim, 2] call EFUNC(common,doAnimation); diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp index 56c1eec401..167765c576 100644 --- a/addons/medical_engine/script_macros_medical.hpp +++ b/addons/medical_engine/script_macros_medical.hpp @@ -42,6 +42,7 @@ #define GET_ARRAY(config,default) (if (isArray (config)) then {getArray (config)} else {default}) #define DEFAULT_HEART_RATE 80 +#define DEFAULT_SPO2 97 #define DEFAULT_PERIPH_RES 100 // --- blood @@ -52,7 +53,8 @@ #define BLOOD_VOLUME_CLASS_2_HEMORRHAGE 5.100 // lost more than 15% blood, Class II Hemorrhage #define BLOOD_VOLUME_CLASS_3_HEMORRHAGE 4.200 // lost more than 30% blood, Class III Hemorrhage #define BLOOD_VOLUME_CLASS_4_HEMORRHAGE 3.600 // lost more than 40% blood, Class IV Hemorrhage -#define BLOOD_VOLUME_FATAL 3.0 // Lost more than 50% blood, Unrecoverable +// Lost more than 50% blood, Unrecoverable +#define BLOOD_VOLUME_FATAL 3.0 // Minimum blood volume, in liters, for a patient to have the chance to wake up #define MINIMUM_BLOOD_FOR_STABLE_VITALS EGVAR(medical,const_stableVitalsBloodThreshold) @@ -106,6 +108,10 @@ #define FRACTURE_DAMAGE_THRESHOLD EGVAR(medical,const_fractureDamageThreshold) #define FRACTURE_DAMAGE_THRESHOLD_DEFAULT 0.50 +// Minimum cardiac output +#define CARDIAC_OUTPUT_MIN EGVAR(medical,const_minCardiacOutput) +#define CARDIAC_OUTPUT_MIN_DEFAULT 0.05 + // Minimum body part damage required for blood effect on uniform #define VISUAL_BODY_DAMAGE_THRESHOLD 0.35 @@ -153,6 +159,8 @@ #define VAR_WOUND_BLEEDING QEGVAR(medical,woundBleeding) #define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest) #define VAR_HEART_RATE QEGVAR(medical,heartRate) +#define VAR_SPO2 QEGVAR(medical,spo2) +#define VAR_OXYGEN_DEMAND QEGVAR(medical,oxygenDemand) #define VAR_PAIN QEGVAR(medical,pain) #define VAR_PAIN_SUPP QEGVAR(medical,painSuppress) #define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance) @@ -175,6 +183,7 @@ #define GET_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME]) #define GET_WOUND_BLEEDING(unit) (unit getVariable [VAR_WOUND_BLEEDING, 0]) #define GET_HEART_RATE(unit) (unit getVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE]) +#define GET_SPO2(unit) (unit getVariable [VAR_SPO2, DEFAULT_SPO2]) #define GET_HEMORRHAGE(unit) (unit getVariable [VAR_HEMORRHAGE, 0]) #define GET_PAIN(unit) (unit getVariable [VAR_PAIN, 0]) #define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP, 0]) diff --git a/addons/medical_engine/stringtable.xml b/addons/medical_engine/stringtable.xml index 9a4179a38c..1765df0d39 100644 --- a/addons/medical_engine/stringtable.xml +++ b/addons/medical_engine/stringtable.xml @@ -20,7 +20,7 @@ Controla si la tripulación recibe daño debido a colisiones en vehículo. Définit si les passagers à bord des véhicules peuvent être blessés en cas d'accident. Kontroluje czy załoga pojazdu otrzyma obrażenia podczas kolizji pojazdu. - 車両が衝突をすると乗員がダメージを受けるかどうかを決定します。 + 車両が衝突をすると乗員がダメージを受けるかどうかを制御します。 Kontrolliert, ob Besatzung eines Fahrzeugs Schaden durch Unfälle erleiden soll Determina se i passeggeri di un veicolo subiranno danni da schianti o incidenti. 控制乘员是否受到车辆碰撞的伤害。 @@ -36,6 +36,7 @@ Fattore di Trapasso Armatura Efeito de Penetração de Blindagem 装甲貫通効果 + Эффект сквозного прохождения брони Controls effect of armor 'passThrough' on final damage. Makes high armor values, like ones used in GL rigs, less effective.\nUse 0% for pre 3.16.0 armor behavior.\nOnly touch this if you know what you're doing! @@ -46,6 +47,7 @@ Determina l'effetto di danni sul corpo che 'trapassano' l'armatura. Rende alti valori di protezione, come quelli su corpetti GL, meno efficaci.\nUtilizza 0% per il comportamento prima di v3.16.0.\nModifica questo valore solo se sai cosa stai facendo! Controla o efeito de penetração (passThrough) da blindagem no dano final. Torna valores de blindagem altos, como os usados em coletes GL, menos eficazes.\nUse 0% para o comportamento de blindagem anterior à versão 3.16.0.\nSó mexa nisso se souber o que está fazendo! ボディアーマーの'passThrough'値が最終的な身体ダメージに与える影響を調整します。擲弾兵リグで使用されるような高い装甲値では効果が低くなります。\n3.16.0以前の挙動にするには0%にしてください。\nこれが何かわからない場合は変更しないことをお勧めします。 + Контролирует эффект `passThrough` при нанесении конечного урона. Делает высокие значения брони, подобные тем, которые используются в GL rigs, менее эффективными.\nИспользуйте 0% для поведения брони до версии 3.16.0.n\Прикасайтесь к этому, только если знаете, что делаете! diff --git a/addons/medical_feedback/XEH_postInit.sqf b/addons/medical_feedback/XEH_postInit.sqf index 96d15dbf21..f01394e919 100644 --- a/addons/medical_feedback/XEH_postInit.sqf +++ b/addons/medical_feedback/XEH_postInit.sqf @@ -30,7 +30,7 @@ GVAR(bloodTickCounter) = 0; [false] call FUNC(initEffects); [true] call FUNC(handleEffects); -[FUNC(handleEffects), 1, false] call CBA_fnc_addPerFrameHandler; +[LINKFUNC(handleEffects), 1, false] call CBA_fnc_addPerFrameHandler; ["ace_unconscious", { params ["_unit", "_unconscious"]; @@ -104,7 +104,7 @@ GVAR(bloodTickCounter) = 0; if (ACE_player distance _unit > _distance) exitWith {}; - if (vehicle _unit == _unit) then { + if (isNull objectParent _unit) then { // say3D waits for the previous sound to finish, so use a dummy instead private _dummy = "#dynamicsound" createVehicleLocal [0, 0, 0]; _dummy attachTo [_unit, [0, 0, 0], "camera"]; diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index f2777f6fd4..5ff49d2167 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -102,7 +102,7 @@ GVAR(selfInteractionActions) = []; params ["_unit", "_allDamages", ""]; if !(GVAR(peekMedicalOnHit) && {_unit == ACE_player}) exitWith {}; - private _bodypart = toLower (_allDamages select 0 select 1); + private _bodypart = toLowerANSI (_allDamages select 0 select 1); private _bodypartIndex = ALL_BODY_PARTS find _bodypart; [ACE_player, _bodypartIndex] call FUNC(displayPatientInformation); diff --git a/addons/medical_gui/functions/fnc_addTreatmentActions.sqf b/addons/medical_gui/functions/fnc_addTreatmentActions.sqf index 3df89894d2..b27801766b 100644 --- a/addons/medical_gui/functions/fnc_addTreatmentActions.sqf +++ b/addons/medical_gui/functions/fnc_addTreatmentActions.sqf @@ -36,14 +36,14 @@ private _fnc_condition = { private _displayName = getText (_x >> "displayName"); private _icon = getText (_x >> "icon"); - private _allowedBodyParts = getArray (_x >> "allowedSelections") apply {toLower _x}; + private _allowedBodyParts = getArray (_x >> "allowedSelections") apply {toLowerANSI _x}; if (_allowedBodyParts isEqualTo ["all"]) then { - _allowedBodyParts = ALL_BODY_PARTS apply {toLower _x}; + _allowedBodyParts = ALL_BODY_PARTS apply {toLowerANSI _x}; }; { private _bodyPart = _x; - private _actionPath = _actionPaths select (ALL_BODY_PARTS find toLower _bodyPart); + private _actionPath = _actionPaths select (ALL_BODY_PARTS find toLowerANSI _bodyPart); private _action = [ _actionName, diff --git a/addons/medical_gui/functions/fnc_collectActions.sqf b/addons/medical_gui/functions/fnc_collectActions.sqf index 818decb017..1620b2c5cb 100644 --- a/addons/medical_gui/functions/fnc_collectActions.sqf +++ b/addons/medical_gui/functions/fnc_collectActions.sqf @@ -22,8 +22,8 @@ GVAR(actions) = []; private _configName = configName _x; private _displayName = getText (_x >> "displayName"); private _category = getText (_x >> "category"); - private _condition = compile format [QUOTE([ARR_4(ACE_player, GVAR(target), %1 select GVAR(selectedBodyPart), '%2')] call DEFUNC(medical_treatment,canTreatCached)), ALL_BODY_PARTS, _configName]; - private _statement = compile format [QUOTE([ARR_4(ACE_player, GVAR(target), %1 select GVAR(selectedBodyPart), '%2')] call DEFUNC(medical_treatment,treatment)), ALL_BODY_PARTS, _configName]; + private _condition = compile format [QUOTE([ARR_4(ACE_player,GVAR(target),%1 select GVAR(selectedBodyPart),'%2')] call DEFUNC(medical_treatment,canTreatCached)), ALL_BODY_PARTS, _configName]; + private _statement = compile format [QUOTE([ARR_4(ACE_player,GVAR(target),%1 select GVAR(selectedBodyPart),'%2')] call DEFUNC(medical_treatment,treatment)), ALL_BODY_PARTS, _configName]; private _items = getArray (_x >> "items"); GVAR(actions) pushBack [_displayName, _category, _condition, _statement, _items]; @@ -32,7 +32,7 @@ GVAR(actions) = []; if ("ace_dragging" call EFUNC(common,isModLoaded)) then { GVAR(actions) pushBack [ - localize ELSTRING(dragging,Drag), "drag", + LELSTRING(dragging,Drag), "drag", {ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canDrag)}}, { GVAR(pendingReopen) = false; @@ -41,7 +41,7 @@ if ("ace_dragging" call EFUNC(common,isModLoaded)) then { ]; GVAR(actions) pushBack [ - localize ELSTRING(dragging,Carry), "drag", + LELSTRING(dragging,Carry), "drag", {ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canCarry)}}, { GVAR(pendingReopen) = false; diff --git a/addons/medical_gui/functions/fnc_countTreatmentItems.sqf b/addons/medical_gui/functions/fnc_countTreatmentItems.sqf index 102d996bb3..ac7c4857e6 100644 --- a/addons/medical_gui/functions/fnc_countTreatmentItems.sqf +++ b/addons/medical_gui/functions/fnc_countTreatmentItems.sqf @@ -38,16 +38,31 @@ if (ACE_player != GVAR(target)) then { // Vehicle private _medicVehicle = objectParent ACE_player; private _patientVehicle = objectParent GVAR(target); -private _vehicle = if (!isNull _medicVehicle) then {_medicVehicle} else {_patientVehicle}; +private _vehicle = [_patientVehicle, _medicVehicle] select (!isNull _medicVehicle); if (!isNull _vehicle) then { _vehicleCount = 0; - (getItemCargo _vehicle) params ["_itemTypes", "_itemCounts"]; + private _magazineItems = []; + private _itemItems = []; { - private _item = _x; - private _index = _itemTypes find _item; - _vehicleCount = _vehicleCount + (_itemCounts param [_index, 0]); + if (isClass (configFile >> "CfgMagazines" >> _x)) then { + _magazineItems pushBack _x; + } else { + _itemItems pushBack _x; + }; } forEach _items; + if (_magazineItems isNotEqualTo []) then { + (getMagazineCargo _vehicle) params ["_itemTypes", "_itemCounts"]; + { + _vehicleCount = _vehicleCount + (_itemCounts param [_itemTypes find _x, 0]); + } forEach _magazineItems; + }; + if (_itemItems isNotEqualTo []) then { + (getItemCargo _vehicle) params ["_itemTypes", "_itemCounts"]; + { + _vehicleCount = _vehicleCount + (_itemCounts param [_itemTypes find _x, 0]); + } forEach _itemItems; + }; }; [_medicCount, _patientCount, _vehicleCount] diff --git a/addons/medical_gui/functions/fnc_handleToggle.sqf b/addons/medical_gui/functions/fnc_handleToggle.sqf index f0448fc3a3..48232790c1 100644 --- a/addons/medical_gui/functions/fnc_handleToggle.sqf +++ b/addons/medical_gui/functions/fnc_handleToggle.sqf @@ -19,15 +19,14 @@ if (!isNull findDisplay 312) exitWith {}; // Find new target to switch to -private _target = if ( +private _target = [ + ACE_player, + GVAR(previousTarget) +] select ( GVAR(target) == ACE_player && {[ACE_player, GVAR(previousTarget)] call EFUNC(common,canInteractWith)} && {[ACE_player, GVAR(previousTarget)] call FUNC(canOpenMenu)} -) then { - GVAR(previousTarget); -} else { - ACE_player; -}; +); // Exit if new target is same as old if (GVAR(target) == _target) exitWith {}; diff --git a/addons/medical_gui/functions/fnc_onMenuOpen.sqf b/addons/medical_gui/functions/fnc_onMenuOpen.sqf index e77d92bddd..12b27b60d9 100644 --- a/addons/medical_gui/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_gui/functions/fnc_onMenuOpen.sqf @@ -41,7 +41,7 @@ if (GVAR(menuPFH) != -1) exitWith { TRACE_1("Menu PFH already running",GVAR(menuPFH)); }; -GVAR(menuPFH) = [FUNC(menuPFH), 0, []] call CBA_fnc_addPerFrameHandler; +GVAR(menuPFH) = [LINKFUNC(menuPFH), 0, []] call CBA_fnc_addPerFrameHandler; // Hide categories if they don't have any actions (airway) private _list = [ diff --git a/addons/medical_gui/functions/fnc_updateBodyImage.sqf b/addons/medical_gui/functions/fnc_updateBodyImage.sqf index 4d22b68a2d..b8ee8ee240 100644 --- a/addons/medical_gui/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_gui/functions/fnc_updateBodyImage.sqf @@ -105,3 +105,5 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; [IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_S, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B], [IDC_BODY_LEGRIGHT, IDC_BODY_LEGRIGHT_S, IDC_BODY_LEGRIGHT_T, IDC_BODY_LEGRIGHT_B] ]; + +[QGVAR(updateBodyImage), [_ctrlGroup, _target, _selectionN]] call CBA_fnc_localEvent; diff --git a/addons/medical_gui/functions/fnc_updateCategories.sqf b/addons/medical_gui/functions/fnc_updateCategories.sqf index c9917a8758..c2f1d2a11c 100644 --- a/addons/medical_gui/functions/fnc_updateCategories.sqf +++ b/addons/medical_gui/functions/fnc_updateCategories.sqf @@ -21,8 +21,9 @@ params ["_display"]; _x params ["_idc", "_category"]; private _ctrl = _display displayCtrl _idc; - private _enable = GVAR(actions) findIf {_category == _x select 1 && {call (_x select 2)}} > -1; - if (_category isEqualTo "triage") then {_enable = true}; + private _enable = if (_category == "triage") then { true } else { + GVAR(actions) findIf {_category == _x select 1 && {call (_x select 2)}} > -1 + }; _ctrl ctrlEnable _enable; private _selectedColor = [ diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index 328e80242a..3219eb025f 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -24,24 +24,31 @@ private _nonissueColor = [1, 1, 1, 0.33]; // Indicate if unit is bleeding at all if (IS_BLEEDING(_target)) then { - // Give a qualitative description of the rate of bleeding - private _cardiacOutput = [_target] call EFUNC(medical_status,getCardiacOutput); - private _bleedRate = GET_BLOOD_LOSS(_target); - private _bleedRateKO = BLOOD_LOSS_KNOCK_OUT_THRESHOLD * (_cardiacOutput max 0.05); - // Use nonzero minimum cardiac output to prevent all bleeding showing as massive during cardiac arrest - - switch (true) do { - case (_bleedRate < _bleedRateKO * BLEED_RATE_SLOW): { - _entries pushBack [localize LSTRING(Bleed_Rate1), [1, 1, 0, 1]]; + switch (GVAR(showBleeding)) do { + case 1: { + // Just show whether the unit is bleeding at all + _entries pushBack [localize LSTRING(Status_Bleeding), [1, 0, 0, 1]]; }; - case (_bleedRate < _bleedRateKO * BLEED_RATE_MODERATE): { - _entries pushBack [localize LSTRING(Bleed_Rate2), [1, 0.67, 0, 1]]; - }; - case (_bleedRate < _bleedRateKO * BLEED_RATE_SEVERE): { - _entries pushBack [localize LSTRING(Bleed_Rate3), [1, 0.33, 0, 1]]; - }; - default { - _entries pushBack [localize LSTRING(Bleed_Rate4), [1, 0, 0, 1]]; + case 2: { + // Give a qualitative description of the rate of bleeding + private _cardiacOutput = [_target] call EFUNC(medical_status,getCardiacOutput); + private _bleedRate = GET_BLOOD_LOSS(_target); + private _bleedRateKO = BLOOD_LOSS_KNOCK_OUT_THRESHOLD * (_cardiacOutput max 0.05); + // Use nonzero minimum cardiac output to prevent all bleeding showing as massive during cardiac arrest + switch (true) do { + case (_bleedRate < _bleedRateKO * BLEED_RATE_SLOW): { + _entries pushBack [localize LSTRING(Bleed_Rate1), [1, 1, 0, 1]]; + }; + case (_bleedRate < _bleedRateKO * BLEED_RATE_MODERATE): { + _entries pushBack [localize LSTRING(Bleed_Rate2), [1, 0.67, 0, 1]]; + }; + case (_bleedRate < _bleedRateKO * BLEED_RATE_SEVERE): { + _entries pushBack [localize LSTRING(Bleed_Rate3), [1, 0.33, 0, 1]]; + }; + default { + _entries pushBack [localize LSTRING(Bleed_Rate4), [1, 0, 0, 1]]; + }; + }; }; }; } else { @@ -70,13 +77,35 @@ if (GVAR(showBloodlossEntry)) then { }; // Show receiving IV volume remaining private _totalIvVolume = 0; +private _saline = 0; +private _blood = 0; +private _plasma = 0; { - _x params ["_volumeRemaining"]; + _x params ["_volumeRemaining", "_type"]; + switch (_type) do { + case "Saline": { + _saline = _saline + _volumeRemaining; + }; + case "Blood": { + _blood = _blood + _volumeRemaining; + }; + case "Plasma": { + _plasma = _plasma + _volumeRemaining; + }; + }; _totalIvVolume = _totalIvVolume + _volumeRemaining; } forEach (_target getVariable [QEGVAR(medical,ivBags), []]); -if (_totalIvVolume >= 1) then { - _entries pushBack [format [localize ELSTRING(medical_treatment,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; +if (_totalIvVolume > 0) then { + if (_saline > 0) then { + _entries pushBack [format [localize ELSTRING(medical_treatment,receivingSalineIvVolume), floor _saline], [1, 1, 1, 1]]; + }; + if (_blood > 0) then { + _entries pushBack [format [localize ELSTRING(medical_treatment,receivingBloodIvVolume), floor _blood], [1, 1, 1, 1]]; + }; + if (_plasma > 0) then { + _entries pushBack [format [localize ELSTRING(medical_treatment,receivingPlasmaIvVolume), floor _plasma], [1, 1, 1, 1]]; + }; } else { _entries pushBack [localize ELSTRING(medical_treatment,Status_NoIv), _nonissueColor]; }; @@ -116,6 +145,8 @@ if (_selectionN == -1) exitWith { _ctrl lbSetCurSel -1; }; +[QGVAR(updateInjuryListGeneral), [_ctrl, _target, _selectionN, _entries]] call CBA_fnc_localEvent; + _entries pushBack ["", [1, 1, 1, 1]]; // Add selected body part name @@ -184,6 +215,8 @@ switch (GET_FRACTURES(_target) select _selectionN) do { }; }; +[QGVAR(updateInjuryListPart), [_ctrl, _target, _selectionN, _entries, _bodyPartName]] call CBA_fnc_localEvent; + // Add entries for open, bandaged, and stitched wounds private _woundEntries = []; @@ -216,6 +249,8 @@ private _fnc_processWounds = { [GET_BANDAGED_WOUNDS(_target), "[B] %1", [0.88, 0.7, 0.65, 1]] call _fnc_processWounds; [GET_STITCHED_WOUNDS(_target), "[S] %1", [0.7, 0.7, 0.7, 1]] call _fnc_processWounds; +[QGVAR(updateInjuryListWounds), [_ctrl, _target, _selectionN, _woundEntries, _bodyPartName]] call CBA_fnc_localEvent; + // Handle no wound entries if (_woundEntries isEqualTo []) then { _entries pushBack [localize ELSTRING(medical_treatment,NoInjuriesBodypart), _nonissueColor]; diff --git a/addons/medical_gui/functions/fnc_updateLogList.sqf b/addons/medical_gui/functions/fnc_updateLogList.sqf index d2bb75b63f..51240705f9 100644 --- a/addons/medical_gui/functions/fnc_updateLogList.sqf +++ b/addons/medical_gui/functions/fnc_updateLogList.sqf @@ -23,6 +23,8 @@ lbClear _ctrl; { _x params ["_message", "_timeStamp", "_arguments"]; + private _unlocalizedMessage = _message; + // Localize message and arguments if (isLocalized _message) then { _message = localize _message; @@ -33,5 +35,7 @@ lbClear _ctrl; // Format message with arguments _message = format ([_message] + _arguments); - _ctrl lbAdd format ["%1 %2", _timeStamp, _message]; + private _row = _ctrl lbAdd format ["%1 %2", _timeStamp, _message]; + + [QGVAR(logListAppended), [_ctrl, _row, _message, _unlocalizedMessage, _timeStamp, _arguments]] call CBA_fnc_localEvent; } forEach _logs; diff --git a/addons/medical_gui/initSettings.inc.sqf b/addons/medical_gui/initSettings.inc.sqf index a0418ca74e..dfcbe48925 100644 --- a/addons/medical_gui/initSettings.inc.sqf +++ b/addons/medical_gui/initSettings.inc.sqf @@ -127,6 +127,15 @@ private _categoryColors = [ELSTRING(medical,Interface_Category), format ["| %1 | true // isGlobal ] call CBA_fnc_addSetting; +[ + QGVAR(showBleeding), + "LIST", + [LSTRING(showBleeding_DisplayName), LSTRING(showBleeding_Description)], + [ELSTRING(medical,Interface_Category), LSTRING(SubCategory)], + [[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(ShowBleeding_Rate)], 2], + true // isGlobal +] call CBA_fnc_addSetting; + [ QGVAR(bodyPartOutlineColor), "COLOR", diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 438b160bb2..71388bfb41 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -198,7 +198,7 @@ Maximum distance from which the Medical Menu can be opened. Maximale Entfernung, um das Sanitätsmenü zu öffnen. - 医療メニューを開いたままにできる最大距離を決定します。 + 医療メニューを開いたままにできる最大距離。 Максимальное расстояние, с которого можно открыть Медицинское меню. Définit la distance (en mètres) à partir de laquelle il n'est plus possible d'activer le menu médical pour traiter un patient. A Distância máxima do paciente para que o Menu Médico possa ser aberto. @@ -217,7 +217,7 @@ Mostra livello di Triage nel Menù d'Interazione インタラクションにトリアージ レベルを表示 Mostrar nivel de triado en menú de interacción - Показывать группу триажа в меню взаимодействий + Показать уровень триажа в меню взаимодействия Pokaż poziom Triażu w menu interakcji Zeige Triage-Einstufung im Interaktionsmenü 在交互式菜单中显示分诊级别 @@ -292,6 +292,7 @@ Sbircia Info Mediche Medizinische Info anzeigen 医療情報一時表示 + Просмотр медицинской информации Medical Peek Duration @@ -301,6 +302,7 @@ Durata di sbirciamento di info mediche Dauer zum Anzeigen der medizinischen Info 医療情報一時表示の表示時間 + Продолжительность медицинского осмотра How long the medical info peek remains open after releasing the key. @@ -310,6 +312,7 @@ Wie lange die medizinische Info-Anzeige nach dem Loslassen der Taste geöffnet bleibt. Durata di visualizzazione delle Info Mediche dopo aver rilasciato il tasto. 医療情報一時表示キーを放してからどれだけ長く情報表示するか。 + Как долго окно просмотра медицинской информации остается открытым после отпускания клавиши. Load Patient @@ -562,6 +565,7 @@ Wechseln zu selbst Passa a te stesso 自分に切り替え + Переключиться на себя Switch to target @@ -571,6 +575,7 @@ Wechseln zu Ziel Passa al paziente 相手に切り替え + Переключиться на цель Head @@ -996,6 +1001,7 @@ Keine Blutung Nessuna emorragia 出血はしていない + Кровотечения нет Slow bleeding @@ -1005,6 +1011,7 @@ Langsame Blutung Debole emorragia 出血は穏やか + Медленное кровотечение Moderate bleeding @@ -1014,6 +1021,7 @@ Mäßige Blutung Emorraggia moderata 出血はそこそこ速い + Умеренное кровотечение Severe bleeding @@ -1023,6 +1031,7 @@ Schwere Blutung Forte emorragia 出血は激しい + Сильное кровотечение Massive bleeding @@ -1032,6 +1041,7 @@ Massive Blutung Gravissima emorragia 出血は酷く多い + Огромное кровотечение in Pain @@ -1105,6 +1115,7 @@ Kein Blutverlust Nessuna perdita di sangue 失血なし + Потери крови нет @@ -1346,6 +1357,39 @@ Mostrar la pérdida de sangre cualitativa en la lista de heridas. Afficher la quantité de sang perdue + + Show Bleeding State + Mostrar estado de sangrado + Blutungsstatus anzeigen + Mostra stato di sanguinamento + Mostrar estado de sangramento + 出血状態の表示 + 출혈 상태 표시 + Afficher l'état des saignements + Показать состояние кровотечения + + + Display if the patient is bleeding, optionally with rate + Mostrar si el paciente está sangrando, opcionalmente con tasa + Zeigt an, dass der Patient blutet, optional mit Rate + Mostra se il paziente sta sanguinando, opzionalmente con rateo + Mostrar se o paciente está sangrando, opcionalmente com taxa + 患者が出血しているかどうかを表示します。オプションで出血速度も表示します + 환자가 출혈 중인지 여부를 표시합니다(선택적으로 출혈 속도 포함) + Indique si le patient saigne, éventuellement avec le taux de saignement + Показывает, есть ли у пациента кровотечение, опционально с указанием частоты + + + Show Bleeding Rate + Mostrar tasa de sangrado + Blutungsrate anzeigen + Mostra rateo di sanguinamento + Mostrar taxa de sangramento + 出血速度の表示 + 출혈 속도 표시 + Afficher le taux de saignement + Показать частоту кровотечения + Peek Medical Info on Hit Podgląd Informacji Medycznych po Zranieniu @@ -1355,6 +1399,7 @@ Mostra info mediche se colpito Zeige medizinische Info beim Treffer an 被弾時の医療情報一時表示 + Показать медицинскую информацию о попадании Temporarily show medical info when injured. @@ -1365,6 +1410,7 @@ Mostra temporaneamente le info mediche quando si viene feriti. Bei Verletzungen vorübergehend medizinische Info anzeigen. 被弾時に医療情報を一時的に表示します。 + Временно показывать медицинскую информацию при травме. Medical Peek Duration on Hit @@ -1375,6 +1421,7 @@ Durata di info mediche quando colpito Dauer der Anzeige bei einem Treffer. 被弾時の医療情報一時表示の表示時間 + Продолжительность медицинского осмотра при попадании How long the medical info peek remains open after being injured. @@ -1385,6 +1432,7 @@ Quanto tempo verranno visualizzate le info mediche quando si viene feriti. Wie lange die medizinische Info nach einer Verletzung angezeigt wird. 被弾時の医療情報の一時表示をどれだけ長く表示するか。 + Как долго окно просмотра медицинской информации остается открытым после получения травмы. Show Trauma Sustained @@ -1396,6 +1444,7 @@ 외상 지속 표시 显示遭受的创伤 Afficher les traumatismes subis + Показать полученную травму Show trauma sustained in the injury list. @@ -1407,6 +1456,7 @@ 부상 목록에 발생한 외상을 표시합니다. 在伤情表上显示创伤 Afficher les traumatismes subis dans la liste des blessures. + Показать полученную травму в списке травм. Body Part Outline Color @@ -1417,6 +1467,7 @@ Colore del contorno di parti del corpo Umrissfarbe des Körperteils 身体部位の輪郭表示の色 + Цвет контура части тела Color of outline around selected body part. @@ -1427,6 +1478,7 @@ Colore del contorno della parte del corpo selezionata. Farbe des Umrisses um das ausgewählten Körperteil. 選択した身体部位の輪郭表示の色。 + Цвет контура вокруг выбранной части тела. Minor Trauma @@ -1438,6 +1490,7 @@ 약한 외상 轻微创伤 Traumatisme mineur + Незначительная травма Major Trauma @@ -1449,6 +1502,7 @@ 중간 외상 中度创伤 Traumatisme majeur + Серьезная травма Severe Trauma @@ -1460,6 +1514,7 @@ 강한 외상 重度创伤 Traumatisme grave + Тяжелая травма Chronic Trauma @@ -1471,6 +1526,7 @@ 심각한 외상 慢性创伤 Traumatisme chronique + Хроническая травма L @@ -1481,6 +1537,7 @@ Sx L + Лево R @@ -1491,6 +1548,7 @@ Dx R + Право in your inventory @@ -1501,6 +1559,7 @@ Nel proprio inventario im Inventar 個あなたが保有 + в вашем инвентаре in patient's inventory @@ -1511,6 +1570,7 @@ Nell'inventario del paziente im Inventar des Patienten 個患者が保有 + в инвентаре пациента in vehicle's inventory @@ -1521,6 +1581,7 @@ im Inventar des Fahrzeuges Nell'inventario del veicolo 個車両内に保有 + в инвентаре транспорта No effect until tourniquet removed @@ -1530,6 +1591,7 @@ Keine Wirkung, bis das Tourniquet entfernt wurde Nessun effetto fino alla rimozione del laccio emostatico 止血帯を外すまで効果を発揮しません + Никакого эффекта до тех пор, пока жгут не будет снят Show Tourniquet Warning @@ -1539,6 +1601,7 @@ Tourniquet-Warnung anzeigen Mostra avviso di laccio emostatico 止血帯の警告を表示 + Показать предупреждение о наложении жгута Show a warning tooltip when a tourniquet will interfere with a medical action. @@ -1548,6 +1611,7 @@ Zeigt einen Hinweis an, wenn ein Tourniquet eine medizinische Maßnahme beeinträchtigt. Mostra un avviso se un laccio emostatico impedisce un trattamento medico. 止血帯が医療行為を妨げる場合には、警告ツールチップを表示します。 + Показать всплывающую подсказку с предупреждением, когда жгут помешает медицинскому вмешательству. diff --git a/addons/medical_gui/ui/painkillers.paa b/addons/medical_gui/ui/painkillers.paa new file mode 100644 index 0000000000..3c5da9b30b Binary files /dev/null and b/addons/medical_gui/ui/painkillers.paa differ diff --git a/addons/medical_statemachine/CfgEventHandlers.hpp b/addons/medical_statemachine/CfgEventHandlers.hpp index 98c29f77dc..b9150d8564 100644 --- a/addons/medical_statemachine/CfgEventHandlers.hpp +++ b/addons/medical_statemachine/CfgEventHandlers.hpp @@ -10,6 +10,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; + class Extended_Respawn_EventHandlers { class CAManBase { class ADDON { diff --git a/addons/medical_statemachine/XEH_postInit.sqf b/addons/medical_statemachine/XEH_postInit.sqf new file mode 100644 index 0000000000..a7c7740a39 --- /dev/null +++ b/addons/medical_statemachine/XEH_postInit.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +["ace_killed", { // global event + params ["_unit"]; + + // Prevent second ragdoll of uncon units when they're killed + if ( + IS_UNCONSCIOUS(_unit) && !isAwake _unit // uncon and not ragdolling + && {isPlayer _unit || {_unit getVariable [QGVAR(AIUnconsciousness), GVAR(AIUnconsciousness)]}} + ) then { + _unit enableSimulation false; + [{_this enableSimulation true}, _unit, 2] call CBA_fnc_waitAndExecute; + }; +}] call CBA_fnc_addEventHandler; diff --git a/addons/medical_statemachine/stringtable.xml b/addons/medical_statemachine/stringtable.xml index 1b29b1c553..2b828d506e 100644 --- a/addons/medical_statemachine/stringtable.xml +++ b/addons/medical_statemachine/stringtable.xml @@ -68,7 +68,7 @@ Controls when AI can receive fatal injuries. A fatal injury is caused by significant damage to the head or troso.\nWhen set to "Always", this effectively produces "AI Instant Death" behaviour as AI will immediately die from any fatal injury.\nNOTE: Any mode other than "Always" requires AI Unconsciousness to be enabled. Controla quando a IA pode receber lesões fatais. Uma lesão fatal é causada por um dano significante na cabeça ou tronco.\nQuando definido para "Sempre", isso efetivamente causa a "Morte Instantânea da IA", pois a IA irá imediatamente morrer para qualquer lesão fatal.\nNOTA: Qualquer opção além de "Sempre" requer que Inconsciência de IA esteja ativada. - AIが致命傷を受けた時の挙動を管理できます。頭部や胸部に受ける大きなダメージは致命傷になります。\n"常に"に設定されていると、いかなる致命傷でも"AIの即死"効果が生まれます。\n注: "常に"以外のモードでは"AIの気絶"を有効化させる必要があります。 + AIが致命傷を受けた時の挙動を管理できます。頭部や胸部に受ける大きなダメージは致命傷になります。\n"常に"に設定されていると、いかなる致命傷でも"AIの即死"効果が生まれます。\n注: "常に"以外のモードでは"AIの無意識状態化"を有効化させる必要があります。 控制當AI受致命傷時是否能救起。致命傷是指對頭部或身體造成可觀傷害所造成的。\n當設置為"總是"時,這會使其與"AI 瞬間死亡"同一個效果,在AI受到致命傷時瞬間死亡。\n備註:選了"總是"以外的選項的話必須開啟「AI無意識」的選項。 控制当 AI 受致命伤时是否能救起。致命伤是指对头部或躯干遭受重大伤害。\n当设置为"总是"时,这将有效地产生"AI 即时死亡"行为,因为 AI 将立即死于任何致命伤。\n注意:"总是"以外的任何模式都需要启用 AI 无意识。 Détermine si les unités IA décèdent en cas de blessure mortelle. Une blessure mortelle est définie par des dommages importants à la tête ou au cœur.\nSi réglé sur "Toujours", cela produit effectivement un comportement de "Mort instantanée" car les unités IA mourront immédiatement de toute blessure mortelle.\nNOTE : Tout mode autre que "Toujours" nécessite l'activation de l'option "Inconscience IA". @@ -92,7 +92,7 @@ Inconscience IA AI eszméletlenség Incoscienza IA - AIの気絶 + AIの無意識状態化 인공지능 기절 AI 无意识 AI無意識 @@ -101,7 +101,7 @@ Controls whether AI can go unconscious instead of immediately dying.\nThis setting works together with the "AI Fatal Injuries" setting since, going into cardiac arrest requires that the unit is able to go unconscious.\nHowever, these settings are separated because units can go unconscious from critical vitals resulting from non-fatal injuries.\nIn essence, this means that in order to enable cardiac arrest for AI units, this setting must be enabled. Controla se a IA pode ficar inconsciente ao invés de morrer imediatamente.\nEssa configuração funciona com "Lesões Fatais de IA", pois para uma unidade ter uma parada cardíaca é necessário que a IA possa fica inconsciente.\nContudo, essas configurações são separadas pois unidades podem ficar inconscientes por vitais críticos causados por ferimentos não-fatais.\nEssencialmente, isso significa que para ativar uma parada cardíaca em IA, essa configuração precisa estar ativa. - AIが即死する代わりに気絶するかどうかを決定できます。\nこれは "AIの致命傷" 設定と連動します。これは心停止を起こすにはユニットが気絶する必要がある為です。\nしかしながら、これらの設定はユニットが非致死性の負傷により重体となって気絶できるよう分離されています。\n本質的にはこの設定はAIユニットの心停止を可能にするものであり、有効化されておくべきです。 + AIが即死する代わりに無意識状態化するかどうかを制御します。\nこれは "AIの致命傷" 設定と連動します。何故ならば、ユニットを心停止させるためには無意識状態に陥る必要がある為です。\nしかし、これらの設定は、致命的ではない負傷の経過による重症状態化でユニットが無意識状態に陥ることが出来るようにするため、分割されています。\n要するに、AIユニットの心停止を有効にするには、この設定を有効にする必要があるということです。 控制AI是否能進入無意識狀態而非立刻原地死亡。\n這個選項會與「AI致命傷」的選項聯動,使單位心搏停止的話必須先讓其無意識。\n然而,兩個設定分開之原因是使單位能因從非致命傷的攻擊情況下進入生命危險的狀態。\n簡單來說,你想要讓AI單位有心搏停止可能的話,該選項必須啟用。 控制 AI 是否可以进入昏迷状态而不是立即死亡。\n这个设置与"AI 致命伤"设置一起工作,因为进入心脏骤停需要单位能够昏迷。\n然而,这些设置是分开的,因为单位可能会因非致命伤害导致的关键生命体征而昏迷过去。\n从本质上讲,这意味着为了使 AI 单位的心脏骤停,必须启用此设置。 Définit si les unités IA peuvent perdre connaissance au lieu de mourir immédiatement.\nCe paramètre fonctionne conjointement avec l'option "Décès si blessure mortelle (IA)" car, pour qu'une unité IA subisse un arrêt cardiaque, elle doit également pouvoir perdre connaissance.\nCependant, ces paramètres sont séparés car les unités peuvent s'évanouir suite à des signes vitaux critiques résultant de blessures non mortelles.\nEn résumé, cela signifie que ce paramètre doit absolument être activé pour qu'une unité IA puisse entrer en état d'arrêt cardiaque. @@ -132,7 +132,7 @@ Controls how long it takes to die from cardiac arrest. - どのくらいの時間、心停止すると死亡するかを決定します。 + どのくらいの時間、心停止すると死亡するかを制御します。 Définit le temps qu'il faut pour mourir d'un arrêt cardiaque. Контролирует, сколько времени требуется, чтобы умереть от остановки сердца. Controla o tempo necessário para morrer para uma parada cardíaca. diff --git a/addons/medical_status/XEH_preInit.sqf b/addons/medical_status/XEH_preInit.sqf index e3c82d5788..82146d82e1 100644 --- a/addons/medical_status/XEH_preInit.sqf +++ b/addons/medical_status/XEH_preInit.sqf @@ -12,9 +12,8 @@ PREP_RECOMPILE_END; ["CAManBase", "init", { params ["_unit"]; - private _config = configOf _unit; - if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; - if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; + if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; + if (getNumber ((configOf _unit) >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; // Hopefully this EH gets added first as it can only effect other EH called after it private _ehIndex = _unit addEventHandler ["Killed", {_this call FUNC(handleKilled)}]; diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 4c101c7521..8770eaf0ae 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -7,10 +7,10 @@ * 0: The Unit * 1: Medication * 2: Time in system for the adjustment to reach its peak - * 3: Duration the adjustment will have an effect - * 4: Heart Rate Adjust - * 5: Pain Suppress Adjust - * 6: Flow Adjust + * 3: Duration the adjustment will have an effect + * 4: Heart Rate Adjust + * 5: Pain Suppress Adjust + * 6: Flow Adjust * * Return Value: * None diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index 8ff0fbff3b..c2a6604679 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -23,4 +23,10 @@ if (_woundBleeding == 0) exitWith {0}; private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); // even if heart stops blood will still flow slowly (gravity) -(_woundBleeding * (_cardiacOutput max 0.05) * EGVAR(medical,bleedingCoefficient)) +private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient)); + +private _eventArgs = [_unit, _bloodLoss]; // Pass by reference + +[QGVAR(getBloodLoss), _eventArgs] call CBA_fnc_localEvent; + +_eventArgs select 1 // return diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 786f2be950..278163d90b 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -32,13 +32,15 @@ if (damage _unit > 0) then { if (_isRespawn) then { TRACE_1("reseting all vars on respawn",_isRespawn); // note: state is handled by ace_medical_statemachine_fnc_resetStateDefault - // - Blood and heart ---------------------------------------------------------- + // - Vitals ------------------------------------------------------------------ _unit setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true]; _unit setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true]; _unit setVariable [VAR_BLOOD_PRESS, [80, 120], true]; _unit setVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES, true]; _unit setVariable [VAR_CRDC_ARRST, false, true]; _unit setVariable [VAR_HEMORRHAGE, 0, true]; + _unit setVariable [VAR_SPO2, DEFAULT_SPO2, true]; + _unit setVariable [VAR_OXYGEN_DEMAND, 0, true]; // - Pain --------------------------------------------------------------------- _unit setVariable [VAR_PAIN, 0, true]; diff --git a/addons/medical_status/functions/fnc_setDead.sqf b/addons/medical_status/functions/fnc_setDead.sqf index 9dfc07d114..cb1e1f1d6f 100644 --- a/addons/medical_status/functions/fnc_setDead.sqf +++ b/addons/medical_status/functions/fnc_setDead.sqf @@ -17,10 +17,14 @@ params ["_unit", ["_reason", "#setDead"], ["_instigator", objNull]]; TRACE_3("setDead",_unit,_reason,_instigator); + // No heart rate or blood pressure to measure when dead _unit setVariable [VAR_HEART_RATE, 0, true]; _unit setVariable [VAR_BLOOD_PRESS, [0, 0], true]; +// Clear uncon variable just to be safe +_unit setVariable [VAR_UNCON, nil, true]; + _unit setVariable [QEGVAR(medical,causeOfDeath), _reason, true]; // Send a local event before death diff --git a/addons/medical_status/functions/fnc_setUnconsciousState.sqf b/addons/medical_status/functions/fnc_setUnconsciousState.sqf index e3d34f3b5a..5981343c18 100644 --- a/addons/medical_status/functions/fnc_setUnconsciousState.sqf +++ b/addons/medical_status/functions/fnc_setUnconsciousState.sqf @@ -57,9 +57,19 @@ if (_active) then { // Do "Unlock controls" user action, co-pilot will then have to do the "Take Controls" actions _unit action ["UnlockVehicleControl", vehicle _unit]; }; + + // Disable AI talking (yes, this needs to be explicit) + if (!isPlayer _unit && {_unit checkAIFeature "RADIOPROTOCOL"}) then { + _unit disableAI "RADIOPROTOCOL"; + _unit setVariable [QGVAR(reenableRadioProtocol), true, true]; + }; } else { // Unit has woken up, no longer need to track this _unit setVariable [QEGVAR(medical,lastWakeUpCheck), nil]; + + if (_unit getVariable [QGVAR(reenableRadioProtocol), false]) then { + _unit enableAI "RADIOPROTOCOL"; + }; }; // This event doesn't correspond to unconscious in statemachine diff --git a/addons/medical_status/stringtable.xml b/addons/medical_status/stringtable.xml index f3f3d605d5..f6f51b5533 100644 --- a/addons/medical_status/stringtable.xml +++ b/addons/medical_status/stringtable.xml @@ -105,7 +105,7 @@ Controls how quickly fluid flows out of IV Bags. The IV Bag volume change is calculated as:\ntime interval (s) * iv change per second (4.1667 mL/s) * flow rate (this coefficient). Wie schnell der Effekt der Transfusion eintritt IV 輸液パックから輸液が流出する速度を制御します。 IV 輸液バッグの容量変化は次のように計算されます:\n時間間隔(秒) x 点滴速度毎秒(4.1667 mL/秒) x 流量(この係数) - Определяет, насколько быстро подействуют эффекты внутривенного переливания + Определяет, насколько быстро подействуют эффекты внутривенного переливания как:\nвременной интервал (s) * изменение внутривенного вливания в секунду (4,1667 мл/с) * скорость потока (этот коэффициент). Définit la vitesse à laquelle le liquide s'écoule des poches de perfusion.\nLa variation du volume de poche IV est calculée selon la formule suivante :\n intervalle de temps (s) * variation IV par seconde (4,1667 ml/s) * débit (ce coefficient). Controla o quão rápido fluidos são extraídos de bolsas de IV. A mudança no volume da bolsa d IV é calculado assim:\nIntervalo de tempo (s) * mudança de iv por segundo (4.1667 mL/s) * Velocidade de transferência (esse valor) 控制從點滴輸入人體的液體流量多快。點滴的體積更改是以\n時間間隔(單位秒)乘上點滴每秒速度(4.1667毫升/秒)乘上流量(該係數)。 @@ -125,6 +125,7 @@ 무기 떨어뜨릴 확률 Risque de perte d'arme 武器を落とす確率 + Шанс выпадения оружия Chance for a player to drop their weapon when going unconscious.\nHas no effect on AI. @@ -134,6 +135,7 @@ 플레이어가 기절할 때 무기를 떨어뜨릴 확률입니다.\nAI는 영향을 받지 않습니다. Pourcentage de chances pour un joueur de lâcher son arme lorsqu'il perd connaissance.\nAucun effet sur les IA. プレーヤーが意識を失ったときに武器を落とす可能性。\nAI には影響しません。 + Шанс для игрока выронить свое оружие, когда он теряет сознание.\nНе влияет на ИИ diff --git a/addons/medical_treatment/ACE_Medical_Treatment.hpp b/addons/medical_treatment/ACE_Medical_Treatment.hpp index eeeacf700f..267a45dd44 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment.hpp @@ -565,8 +565,11 @@ class ADDON { timeInSystem = 120; // How long until the maximum effect is reached timeTillMaxEffect = 30; - // How many of this type of medication can be in the system before the patient overdoses? + // How many of this type of medication can be in the system before the patient can possibly overdose? maxDose = 4; + // The number of doses over maxDose where there is a chance to overdose. + // Example with maxDose = 4 and maxDoseDeviation = 2: Dose 4: Safe | Dose 5 and 6: Possible overdose | Dose 7: Guaranteed overdose + maxDoseDeviation = 2; // Function to execute upon overdose. Arguments passed to call back are 0: unit , 1: medicationClassName onOverDose = ""; // The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. For liquids, it corresponds to the informal concept of "thickness". This value will increase/decrease the viscoty of the blood with the percentage given. Where 100 = max. Using the minus will decrease viscosity @@ -591,7 +594,7 @@ class ADDON { hrIncreaseHigh[] = {10, 40}; timeInSystem = 120; timeTillMaxEffect = 10; - maxDose = 10; + maxDose = 9; incompatibleMedication[] = {}; }; class Adenosine { @@ -601,14 +604,17 @@ class ADDON { hrIncreaseHigh[] = {-15, -35}; timeInSystem = 120; timeTillMaxEffect = 15; - maxDose = 6; + maxDose = 5; incompatibleMedication[] = {}; }; class PainKillers { - painReduce = 0.1; - timeInSystem = 600; + painReduce = 0.35; + hrIncreaseLow[] = {-5, -10}; + hrIncreaseNormal[] = {-5, -15}; + hrIncreaseHigh[] = {-5, -17}; + timeInSystem = 420; timeTillMaxEffect = 60; - maxDose = 10; + maxDose = 5; incompatibleMedication[] = {}; viscosityChange = 5; }; diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 99a477c3f5..4058132e3d 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -141,6 +141,19 @@ class GVAR(actions) { litter[] = {{"ACE_MedicalLitter_epinephrine"}}; }; + // - Generic Medication --------------------------------------------------- + class Painkillers: Morphine { + displayName = CSTRING(Administer_Painkillers); + displayNameProgress = CSTRING(Administering_Painkillers); + icon = QPATHTOEF(medical_gui,ui\painkillers.paa); + allowedSelections[] = {"Head"}; + medicRequired = 0; + items[] = {"ACE_painkillers"}; + treatmentTime = 4; + sounds[] = {{QPATHTO_R(sounds\Pills.ogg),1,1,50}}; + litter[] = {{"Land_PainKillers_F"}}; // just use BI's model as litter + }; + // - IV Bags -------------------------------------------------------------- class BloodIV: BasicBandage { displayName = CSTRING(Actions_Blood4_1000); diff --git a/addons/medical_treatment/CfgMagazines.hpp b/addons/medical_treatment/CfgMagazines.hpp new file mode 100644 index 0000000000..c4daafab76 --- /dev/null +++ b/addons/medical_treatment/CfgMagazines.hpp @@ -0,0 +1,16 @@ +class CfgMagazines { + class CA_Magazine; + class ACE_painkillers: CA_Magazine { + scope = 2; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(painkillers_Display); + model = "\A3\Structures_F_EPA\Items\Medical\PainKillers_F.p3d"; + picture = QPATHTOF(ui\painkillers_ca.paa); + descriptionShort = CSTRING(painkillers_Desc_Short); + descriptionUse = CSTRING(painkillers_Desc_Use); + ACE_isMedicalItem = 1; + ACE_asItem = 1; + count = 10; + mass = 1; + }; +}; diff --git a/addons/medical_treatment/CfgVehicles.hpp b/addons/medical_treatment/CfgVehicles.hpp index c9144704b5..4f922eb199 100644 --- a/addons/medical_treatment/CfgVehicles.hpp +++ b/addons/medical_treatment/CfgVehicles.hpp @@ -284,6 +284,16 @@ class CfgVehicles { MACRO_ADDITEM(ACE_bodyBag,1); }; }; + class ACE_painkillersItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(painkillers_Display); + author = "Alganthe"; + vehicleClass = "Items"; + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_painkillers,1); + }; + }; // Medical supply crates class ThingX; @@ -303,6 +313,9 @@ class CfgVehicles { model = QPATHTOF(data\ace_medcrate.p3d); editorPreview = QPATHTOF(data\ACE_medicalSupplyCrate.jpg); author = ECSTRING(common,ACETeam); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_painkillers,25); + }; class TransportItems { MACRO_ADDITEM(ACE_fieldDressing,50); MACRO_ADDITEM(ACE_morphine,25); @@ -346,6 +359,9 @@ class CfgVehicles { }; class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { displayName = CSTRING(medicalSupplyCrate_advanced); + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_painkillers,15); + }; class TransportItems { MACRO_ADDITEM(ACE_fieldDressing,25); MACRO_ADDITEM(ACE_packingBandage,25); diff --git a/addons/medical_treatment/XEH_preStart.sqf b/addons/medical_treatment/XEH_preStart.sqf index 27f8f2d9c2..420bffaf71 100644 --- a/addons/medical_treatment/XEH_preStart.sqf +++ b/addons/medical_treatment/XEH_preStart.sqf @@ -2,4 +2,4 @@ #include "XEH_PREP.hpp" -call FUNC(scanMedicalItems) +call FUNC(scanMedicalItems); diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index d0ecbddaef..3782645019 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -11,8 +11,8 @@ ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP) class CfgPatches { class ADDON { name = COMPONENT_NAME; - units[] = {"ACE_fieldDressingItem","ACE_packingBandageItem","ACE_elasticBandageItem","ACE_tourniquetItem","ACE_splintItem","ACE_morphineItem","ACE_adenosineItem","ACE_epinephrineItem","ACE_plasmaIVItem","ACE_bloodIVItem","ACE_salineIVItem","ACE_quikClotItem","ACE_personalAidKitItem","ACE_surgicalKitItem","ACE_sutureItem","ACE_bodyBagItem","ACE_medicalSupplyCrate","ACE_medicalSupplyCrate_advanced"}; - weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_morphine","ACE_adenosine","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_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white"}; + units[] = {"ACE_fieldDressingItem","ACE_packingBandageItem","ACE_elasticBandageItem","ACE_tourniquetItem","ACE_splintItem","ACE_painkillersItem","ACE_morphineItem","ACE_adenosineItem","ACE_epinephrineItem","ACE_plasmaIVItem","ACE_bloodIVItem","ACE_salineIVItem","ACE_quikClotItem","ACE_personalAidKitItem","ACE_surgicalKitItem","ACE_sutureItem","ACE_bodyBagItem","ACE_medicalSupplyCrate","ACE_medicalSupplyCrate_advanced"}; + weapons[] = {"ACE_fieldDressing","ACE_packingBandage","ACE_elasticBandage","ACE_tourniquet","ACE_splint","ACE_painkillers","ACE_morphine","ACE_adenosine","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_suture","ACE_bodyBag","ACE_bodyBag_blue","ACE_bodyBag_white"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_medical_status", "ace_medical_damage", "ace_apl"}; author = ECSTRING(common,ACETeam); @@ -30,5 +30,6 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "Cfg3DEN.hpp" +#include "CfgMagazines.hpp" #endif diff --git a/addons/medical_treatment/functions/fnc_bandage.sqf b/addons/medical_treatment/functions/fnc_bandage.sqf index a4fb2c7698..8657936a66 100644 --- a/addons/medical_treatment/functions/fnc_bandage.sqf +++ b/addons/medical_treatment/functions/fnc_bandage.sqf @@ -8,6 +8,10 @@ * 1: Patient * 2: Body Part * 3: Treatment + * 4: Item User + * 5: Used Item + * 6: Create litter + * 7: Bandage effectiveness coefficient (default: 1) * * Return Value: * None @@ -18,8 +22,11 @@ * Public: No */ -params ["_medic", "_patient", "_bodyPart", "_classname"]; +_this set [7, _this param [7, 1]]; // set bandage effectiveness coefficient +[QGVAR(bandaged), _this] call CBA_fnc_localEvent; // Raise event with reference so mods can modify this + +params ["_medic", "_patient", "_bodyPart", "_classname", "", "", "", "_bandageEffectiveness"]; [_patient, "activity", LSTRING(Activity_bandagedPatient), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[QGVAR(bandageLocal), [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; +[QGVAR(bandageLocal), [_patient, _bodyPart, _classname, _bandageEffectiveness], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_bandageLocal.sqf b/addons/medical_treatment/functions/fnc_bandageLocal.sqf index 0f695c4c61..2c59540fd1 100644 --- a/addons/medical_treatment/functions/fnc_bandageLocal.sqf +++ b/addons/medical_treatment/functions/fnc_bandageLocal.sqf @@ -7,6 +7,7 @@ * 0: Patient * 1: Body Part * 2: Treatment + * 3: Bandage effectiveness coefficient (default: 1) * * Return Value: * None @@ -17,16 +18,16 @@ * Public: No */ -params ["_patient", "_bodyPart", "_bandage"]; -TRACE_3("bandageLocal",_patient,_bodyPart,_bandage); -_bodyPart = toLower _bodyPart; +params ["_patient", "_bodyPart", "_bandage", ["_bandageEffectiveness", 1, [0]]]; +TRACE_4("bandageLocal",_patient,_bodyPart,_bandage,_bandageEffectiveness); +_bodyPart = toLowerANSI _bodyPart; private _openWounds = GET_OPEN_WOUNDS(_patient); private _woundsOnPart = _openWounds getOrDefault [_bodyPart, []]; if (_woundsOnPart isEqualTo []) exitWith {}; // Figure out which injuries for this bodypart are the best choice to bandage -private _targetWounds = [_patient, _bandage, _bodyPart, GVAR(bandageEffectiveness)] call FUNC(findMostEffectiveWounds); +private _targetWounds = [_patient, _bandage, _bodyPart, _bandageEffectiveness * GVAR(bandageEffectiveness)] call FUNC(findMostEffectiveWounds); // Everything is patched up on this body part already if (count _targetWounds == 0) exitWith {}; diff --git a/addons/medical_treatment/functions/fnc_canBandage.sqf b/addons/medical_treatment/functions/fnc_canBandage.sqf index 18fb304d11..808f86b958 100644 --- a/addons/medical_treatment/functions/fnc_canBandage.sqf +++ b/addons/medical_treatment/functions/fnc_canBandage.sqf @@ -20,7 +20,7 @@ */ params ["_medic", "_patient", "_bodyPart", "_bandage"]; -_bodyPart = toLower _bodyPart; +_bodyPart = toLowerANSI _bodyPart; // If patient is swimming, don't allow bandage actions. if (_patient call EFUNC(common,isSwimming)) exitWith {false}; diff --git a/addons/medical_treatment/functions/fnc_canSplint.sqf b/addons/medical_treatment/functions/fnc_canSplint.sqf index f2fc6fa034..bc2b235bf8 100644 --- a/addons/medical_treatment/functions/fnc_canSplint.sqf +++ b/addons/medical_treatment/functions/fnc_canSplint.sqf @@ -19,6 +19,6 @@ params ["", "_patient", "_bodyPart"]; -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; (GET_FRACTURES(_patient) select _partIndex) == 1 diff --git a/addons/medical_treatment/functions/fnc_canTreat.sqf b/addons/medical_treatment/functions/fnc_canTreat.sqf index 995965dfe5..3b643afa2b 100644 --- a/addons/medical_treatment/functions/fnc_canTreat.sqf +++ b/addons/medical_treatment/functions/fnc_canTreat.sqf @@ -28,7 +28,7 @@ private _config = configFile >> QGVAR(actions) >> _classname; ) && { _patient isKindOf "CAManBase" } && { - private _selections = getArray (_config >> "allowedSelections") apply {toLower _x}; + private _selections = getArray (_config >> "allowedSelections") apply {toLowerANSI _x}; "all" in _selections || {_bodyPart in _selections} } && { GET_FUNCTION(_condition,_config >> "condition"); diff --git a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf index 737a40c0ca..3798e64eb4 100644 --- a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf +++ b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf @@ -21,8 +21,16 @@ params ["_medic", "_patient", "_bodyPart"]; private _heartRate = 0; -if (alive _patient && {!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then { - _heartRate = GET_HEART_RATE(_patient); +if (!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then { + _heartRate = switch (true) do { + case (alive _patient): { + GET_HEART_RATE(_patient) + }; + case (alive (_patient getVariable [QEGVAR(medical,CPR_provider), objNull])): { + random [25, 30, 35] // fake heart rate because patient is dead and off state machine + }; + default { 0 }; + }; }; private _heartRateOutput = LSTRING(Check_Pulse_Output_5); @@ -31,7 +39,7 @@ private _logOutput = LSTRING(Check_Pulse_None); if (_heartRate > 1) then { if (_medic call FUNC(isMedic)) then { _heartRateOutput = LSTRING(Check_Pulse_Output_1); - _logOutput = format ["%1", round _heartRate]; + _logOutput = str round _heartRate; } else { _heartRateOutput = LSTRING(Check_Pulse_Output_2); _logOutput = LSTRING(Check_Pulse_Weak); diff --git a/addons/medical_treatment/functions/fnc_createLitter.sqf b/addons/medical_treatment/functions/fnc_createLitter.sqf index 28269bb4ce..df9c2e7f4d 100644 --- a/addons/medical_treatment/functions/fnc_createLitter.sqf +++ b/addons/medical_treatment/functions/fnc_createLitter.sqf @@ -27,7 +27,7 @@ params ["_medic", "_patient", "_bodyPart", "_classname"]; if (vehicle _medic != _medic || {vehicle _patient != _patient}) exitWith {}; // Determine if treated body part is bleeding -private _index = ALL_BODY_PARTS find toLower _bodyPart; +private _index = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _isBleeding = (GET_OPEN_WOUNDS(_patient) get _bodyPart) findIf { _x params ["", "_amountOf", "_bleeding"]; _amountOf * _bleeding > 0 diff --git a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf index e845e04304..dc95c44185 100644 --- a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf @@ -25,6 +25,9 @@ if ((["ace_fire"] call EFUNC(common,isModLoaded)) && {[_patient] call EFUNC(fire _patient setVariable [QEGVAR(fire,intensity), 0, true]; }; +// Allow mods to heal +[QGVAR(fullHealLocalMod), [_patient]] call CBA_fnc_localEvent; + private _state = GET_SM_STATE(_patient); TRACE_1("start",_state); @@ -63,6 +66,8 @@ _patient setVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES, true]; _patient setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true]; _patient setVariable [VAR_BLOOD_PRESS, [80, 120], true]; _patient setVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES, true]; +_patient setVariable [VAR_SPO2, DEFAULT_SPO2, true]; +_patient setVariable [VAR_OXYGEN_DEMAND, 0, true]; // IVs _patient setVariable [QEGVAR(medical,ivBags), nil, true]; diff --git a/addons/medical_treatment/functions/fnc_getBandageTime.sqf b/addons/medical_treatment/functions/fnc_getBandageTime.sqf index ffe5c81f63..eb0a3bc5ae 100644 --- a/addons/medical_treatment/functions/fnc_getBandageTime.sqf +++ b/addons/medical_treatment/functions/fnc_getBandageTime.sqf @@ -20,7 +20,7 @@ params ["_medic", "_patient", "_bodyPart", "_bandage"]; -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; if (_partIndex < 0) exitWith { ERROR_1("invalid partIndex - %1",_this); 0 }; private _targetWounds = [_patient, _bandage, _bodyPart] call FUNC(findMostEffectiveWounds); diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index 69a6118099..b90198f0eb 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -36,7 +36,7 @@ if (isClass (_config >> _bandage)) then { _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; } else { - WARNING_2("No config for bandage [%1] config base [%2]", _bandage, _config); + WARNING_2("No config for bandage [%1] config base [%2]",_bandage,_config); }; if (isClass (_config >> _className)) then { @@ -54,7 +54,7 @@ if (isClass (_config >> _className)) then { _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; }; } else { - WARNING_2("No config for wound type [%1] config base [%2]", _className, _config); + WARNING_2("No config for wound type [%1] config base [%2]",_className,_config); }; TRACE_5("configs",_bandage,_className,_reopeningChance,_reopeningMinDelay,_reopeningMaxDelay); diff --git a/addons/medical_treatment/functions/fnc_hasItem.sqf b/addons/medical_treatment/functions/fnc_hasItem.sqf index e84a79f142..e0ef4c8a4f 100644 --- a/addons/medical_treatment/functions/fnc_hasItem.sqf +++ b/addons/medical_treatment/functions/fnc_hasItem.sqf @@ -25,10 +25,11 @@ params ["_medic", "_patient", "_items"]; private _fnc_checkItems = { params ["_unit"]; - private _unitItems = _unit call EFUNC(common,uniqueItems); + private _unitItems = [_unit, 1] call EFUNC(common,uniqueItems); private _unitVehicle = objectParent _unit; if (!isNull _unitVehicle) then { _unitItems append (itemCargo _unitVehicle); + _unitItems append (magazineCargo _unitVehicle); }; _items findIf {_x in _unitItems} != -1 }; diff --git a/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf index 9ef1261238..56477eafee 100644 --- a/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf @@ -18,6 +18,6 @@ params ["_unit", "_bodyPart"]; -private _index = ALL_BODY_PARTS find toLower _bodyPart; +private _index = ALL_BODY_PARTS find toLowerANSI _bodyPart; _index >= 0 && {HAS_TOURNIQUET_APPLIED_ON(_unit,_index)} diff --git a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf index 2d4468d2c4..d04c1497bd 100644 --- a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf @@ -21,7 +21,7 @@ params ["_unit"]; private _fnc_check = { private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; - CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position, _position vectorAdd [ARR_3(0, 0, 10)], _unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} + CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position,_position vectorAdd [ARR_3(0,0,10)],_unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} }; [[], _fnc_check, _unit, QGVAR(inMedicalFacilityCache), IN_MEDICAL_FACILITY_CACHE_EXPIRY] call EFUNC(common,cachedCall); diff --git a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf index 64eabf844a..80f06fc11e 100644 --- a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf +++ b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf @@ -23,7 +23,7 @@ params ["_patient", "_bodyPart", "_classname"]; private _bloodVolume = GET_BLOOD_VOLUME(_patient); if (_bloodVolume >= DEFAULT_BLOOD_VOLUME) exitWith {}; -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; // Get attributes for the used IV private _defaultConfig = configFile >> QUOTE(ADDON) >> "IV"; diff --git a/addons/medical_treatment/functions/fnc_medication.sqf b/addons/medical_treatment/functions/fnc_medication.sqf index b69a63e994..dfd08d4de2 100644 --- a/addons/medical_treatment/functions/fnc_medication.sqf +++ b/addons/medical_treatment/functions/fnc_medication.sqf @@ -23,6 +23,7 @@ params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"]; [_patient, _usedItem] call FUNC(addToTriageCard); -[_patient, "activity", LSTRING(Activity_usedItem), [[_medic, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call FUNC(addToLog); +private _cfg = ["CfgWeapons", "CfgMagazines"] select (isClass (configFile >> "CfgMagazines" >> _usedItem)); +[_patient, "activity", LSTRING(Activity_usedItem), [[_medic, false, true] call EFUNC(common,getName), getText (configFile >> _cfg >> _usedItem >> "displayName")]] call FUNC(addToLog); [QGVAR(medicationLocal), [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index b5499e9bb4..0b23b365e8 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -19,6 +19,9 @@ // todo: move this macro to script_macros_medical.hpp? #define MORPHINE_PAIN_SUPPRESSION 0.6 +// 0.2625 = 0.6/0.8 * 0.35 +// 0.6 = basic medication morph. pain suppr., 0.8 = adv. medication morph. pain suppr., 0.35 = adv. medication painkillers. pain suppr. +#define PAINKILLERS_PAIN_SUPPRESSION 0.2625 params ["_patient", "_bodyPart", "_classname"]; TRACE_3("medicationLocal",_patient,_bodyPart,_classname); @@ -36,13 +39,17 @@ if (!GVAR(advancedMedication)) exitWith { case "Epinephrine": { [QEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent; }; + case "Painkillers": { + private _painSuppress = GET_PAIN_SUPPRESS(_patient); + _patient setVariable [VAR_PAIN_SUPP, (_painSuppress + PAINKILLERS_PAIN_SUPPRESSION) min 1, true]; + }; }; }; TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_patient); // Handle tourniquet on body part blocking blood flow at injection site -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; if (HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) exitWith { TRACE_1("unit has tourniquets blocking blood flow on injection site",_tourniquets); @@ -59,6 +66,7 @@ private _painReduce = GET_NUMBER(_medicationConfig >> "painReduce",g private _timeInSystem = GET_NUMBER(_medicationConfig >> "timeInSystem",getNumber (_defaultConfig >> "timeInSystem")); private _timeTillMaxEffect = GET_NUMBER(_medicationConfig >> "timeTillMaxEffect",getNumber (_defaultConfig >> "timeTillMaxEffect")); private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); +private _maxDoseDeviation = GET_NUMBER(_medicationConfig >> "maxDoseDeviation",getNumber (_defaultConfig >> "maxDoseDeviation")); private _viscosityChange = GET_NUMBER(_medicationConfig >> "viscosityChange",getNumber (_defaultConfig >> "viscosityChange")); private _hrIncreaseLow = GET_ARRAY(_medicationConfig >> "hrIncreaseLow",getArray (_defaultConfig >> "hrIncreaseLow")); private _hrIncreaseNormal = GET_ARRAY(_medicationConfig >> "hrIncreaseNormal",getArray (_defaultConfig >> "hrIncreaseNormal")); @@ -75,4 +83,4 @@ TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); [_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange] call EFUNC(medical_status,addMedicationAdjustment); // Check for medication compatiblity -[_patient, _className, _maxDose, _incompatibleMedication] call FUNC(onMedicationUsage); +[_patient, _className, _maxDose, _maxDoseDeviation, _incompatibleMedication] call FUNC(onMedicationUsage); diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index 6235358446..cd26d15424 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -6,27 +6,33 @@ * Arguments: * 0: The patient * 1: Medication Treatment classname - * 2: Max dosage (0 to ignore) + * 2: Max dose (0 to ignore) + * 3: Max dose deviation * 3: Incompatable medication > * * Return Value: * None * * Example: - * [player, "morphine", 4, [["x", 1]]] call ace_medical_treatment_fnc_onMedicationUsage + * [player, "morphine", 4, 2, [["x", 1]]] call ace_medical_treatment_fnc_onMedicationUsage * * Public: No */ -params ["_target", "_className", "_maxDosage", "_incompatibleMedication"]; -TRACE_4("onMedicationUsage",_target,_className,_maxDosage,_incompatibleMedication); +params ["_target", "_className", "_maxDose", "_maxDoseDeviation", "_incompatibleMedication"]; +TRACE_5("onMedicationUsage",_target,_className,_maxDose,_maxDoseDeviation,_incompatibleMedication); private _overdosedMedications = []; // Check for overdose from current medication -if (_maxDosage > 0) then { +if (_maxDose > 0) then { private _currentDose = [_target, _className] call EFUNC(medical_status,getMedicationCount); - if (_currentDose >= floor (_maxDosage + round(random(2)))) then { + // Because both {floor random 0} and {floor random 1} return 0 + if (_maxDoseDeviation > 0) then { + _maxDoseDeviation = _maxDoseDeviation + 1; + }; + + if (_currentDose > _maxDose + (floor random _maxDoseDeviation)) then { TRACE_1("exceeded max dose",_currentDose); _overdosedMedications pushBackUnique _className; }; diff --git a/addons/medical_treatment/functions/fnc_splintLocal.sqf b/addons/medical_treatment/functions/fnc_splintLocal.sqf index f415d8296f..ee15a63bf0 100644 --- a/addons/medical_treatment/functions/fnc_splintLocal.sqf +++ b/addons/medical_treatment/functions/fnc_splintLocal.sqf @@ -20,7 +20,7 @@ params ["_medic", "_patient", "_bodyPart"]; TRACE_3("splintLocal",_medic,_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; private _fractures = GET_FRACTURES(_patient); _fractures set [_partIndex, -1]; diff --git a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf index 3fe5f4e55d..9a0480bcb0 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf @@ -19,7 +19,7 @@ params ["_patient", "_bodyPart"]; TRACE_2("tourniquetLocal",_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); _tourniquets set [_partIndex, CBA_missionTime]; diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf index 5c5cf93dc8..8a6be10bb4 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -22,7 +22,7 @@ params ["_medic", "_patient", "_bodyPart"]; TRACE_3("tourniquetRemove",_medic,_patient,_bodyPart); // Remove tourniquet from body part, exit if no tourniquet applied -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); if (_tourniquets select _partIndex == 0) exitWith { diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index b7ebbfd8b0..c524fd7ebb 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -52,7 +52,7 @@ private _userAndItem = if (GET_NUMBER_ENTRY(_config >> "consumeItem") == 1) then [objNull, ""]; // Treatment does not require items to be consumed }; -_userAndItem params ["_itemUser", "_usedItem"]; +_userAndItem params ["_itemUser", "_usedItem", "_createLitter"]; private _isInZeus = !isNull findDisplay 312; @@ -155,13 +155,13 @@ if (_callbackProgress isEqualTo {}) then { _callbackProgress = {true}; }; -[_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem] call _callbackStart; +[_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem, _createLitter] call _callbackStart; -["ace_treatmentStarted", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent; +["ace_treatmentStarted", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem, _createLitter]] call CBA_fnc_localEvent; [ _treatmentTime, - [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem], + [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem, _createLitter], FUNC(treatmentSuccess), FUNC(treatmentFailure), getText (_config >> "displayNameProgress"), diff --git a/addons/medical_treatment/functions/fnc_treatmentFailure.sqf b/addons/medical_treatment/functions/fnc_treatmentFailure.sqf index 64d18fa830..7b3278b2a5 100644 --- a/addons/medical_treatment/functions/fnc_treatmentFailure.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentFailure.sqf @@ -11,6 +11,7 @@ * 3: Treatment * 4: Item User * 5: Used Item + * 6: Create Litter * * Return Value: * None @@ -19,11 +20,15 @@ */ params ["_args"]; -_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem"]; +_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem", "_createLitter"]; // Return used item to user (if used) if (!isNull _itemUser) then { - [_itemUser, _usedItem] call EFUNC(common,addToInventory); + if (isClass (configFile >> "CfgMagazines" >> _usedItem)) then { + [_itemUser, _usedItem, 1] call EFUNC(common,adjustMagazineAmmo); + } else { + [_itemUser, _usedItem] call EFUNC(common,addToInventory); + }; }; // Switch medic to end animation immediately @@ -49,4 +54,4 @@ GET_FUNCTION(_callbackFailure,configFile >> QGVAR(actions) >> _classname >> "cal _args call _callbackFailure; -["ace_treatmentFailed", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent; +["ace_treatmentFailed", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem, _createLitter]] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf b/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf index 96f0d11ead..0c39f7646e 100644 --- a/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf @@ -11,6 +11,7 @@ * 3: Treatment * 4: Item User * 5: Used Item + * 6: Create Litter * * Return Value: * None @@ -19,7 +20,8 @@ */ params ["_args"]; -_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem"]; +_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem", "_createLitter"]; +TRACE_7("",_medic,_patient,_bodyPart,_classname,_itemUser,_usedItem,_createLitter); // Switch medic to end animation immediately private _endInAnim = _medic getVariable QGVAR(endInAnim); @@ -45,7 +47,7 @@ GET_FUNCTION(_callbackSuccess,configFile >> QGVAR(actions) >> _classname >> "cal _args call _callbackSuccess; // Call litter creation handler -_args call FUNC(createLitter); +if (_createLitter) then { _args call FUNC(createLitter); }; // Emit local event for medical API -["ace_treatmentSucceded", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem]] call CBA_fnc_localEvent; +["ace_treatmentSucceded", [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem, _createLitter]] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_useItem.sqf b/addons/medical_treatment/functions/fnc_useItem.sqf index 1f1d7c8355..33ac9f98f4 100644 --- a/addons/medical_treatment/functions/fnc_useItem.sqf +++ b/addons/medical_treatment/functions/fnc_useItem.sqf @@ -10,7 +10,7 @@ * 2: Items * * Return Value: - * User and Item + * User and Item and Litter Created * * Example: * [player, cursorObject, ["bandage"]] call ace_medical_treatment_fnc_useItem @@ -29,20 +29,35 @@ scopeName "Main"; private _useOrder = [[_patient, _medic], [_medic, _patient], [_medic]] select GVAR(allowSharedEquipment); { - private _unit = _x; + private _unit = _x; private _unitVehicle = objectParent _unit; - private _unitItems = _x call EFUNC(common,uniqueItems); + private _unitItems = [_x, 0] call EFUNC(common,uniqueItems); + private _unitMagazines = [_x, 2] call EFUNC(common,uniqueItems); + private _vehicleItems = itemCargo _unitVehicle; // [] for objNull + private _vehicleMagazines = magazineCargo _unitVehicle; // same { - if (!isNull _unitVehicle && {_x in (itemCargo _unitVehicle)}) then { - _unitVehicle addItemCargoGlobal [_x, -1]; - [_unit, _x] breakOut "Main"; - }; - if (_x in _unitItems) then { - _unit removeItem _x; - [_unit, _x] breakOut "Main"; + switch (true) do { + case (_x in _vehicleItems): { + _unitVehicle addItemCargoGlobal [_x, -1]; + [_unit, _x, false] breakOut "Main"; + }; + case (_x in _vehicleMagazines): { + [_unitVehicle, _x] call EFUNC(common,adjustMagazineAmmo); + [_unit, _x, false] breakOut "Main"; + }; + case (_x in _unitItems): { + _unit removeItem _x; + [_unit, _x, true] breakOut "Main"; + }; + case (_x in _unitMagazines): { + private _magsStart = count magazines _unit; + [_unit, _x] call EFUNC(common,adjustMagazineAmmo); + private _magsEnd = count magazines _unit; + [_unit, _x, (_magsEnd < _magsStart)] breakOut "Main"; + }; }; } forEach _items; } forEach _useOrder; -[objNull, ""] +[objNull, "", false] diff --git a/addons/medical_treatment/sounds/Pills.ogg b/addons/medical_treatment/sounds/Pills.ogg new file mode 100644 index 0000000000..7fbe550554 Binary files /dev/null and b/addons/medical_treatment/sounds/Pills.ogg differ diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index da7374984d..29774efb3c 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -70,7 +70,7 @@ Activé & Diagnostic du décès/de l'arrêt cardiaque Włączone i pozwala zdiagnozować Śmierć/Zatrzymanie Akcji Serca 有効 & 死亡/心停止状態を診断可能 - Включено & Может диагностировать смерть/остановку сердца + Включено и может диагностировать смерть/остановку сердца Aktiviert & kann Tod/Herzstillstand diagnostizieren 已启用 & 可以诊断死亡/心搏骤停 활성화 및 사망/심정지 진찰가능 @@ -196,7 +196,7 @@ Controls when hitpoint damage from wounds is healed. - 治療後に負傷箇所にある外傷の状態を決定できます。 + 治療後に負傷箇所にある外傷の状態を制御できます。 Définit à quel moment les blessures sont entièrement soignées. Определяет, когда исцеляется урон от ран. Steuert, wann Trefferpunktschaden von Wunden geheilt wird. @@ -264,7 +264,7 @@ Controls whether medical equipment can be shared between the patient and the medic. - 患者と救護者との間で医療品の共有をするかどうかを決定します。 + 患者と救護者との間で医療品の共有をするかどうかを制御します。 Définit si l'équipement médical du médecin et du patient sont mis en commun, et quel matériel est à utiliser en priorité, le cas échéant. Контролирует, можно ли разделить медикаменты между пациентом и врачом. Controla se um item médico pode ser compartilhado entre médico e paciente. @@ -325,7 +325,7 @@ Time, in seconds, required to administer medication using an autoinjector. Définit le temps nécessaire à l'administration d'une substance auto-injectable (en secondes). - 自動注射器の使用に掛かる時間 (秒) を決定します。 + 自動注射器の使用に掛かる時間。 (秒単位) Tiempo, en segundos, requerido para administrar medicación utilizando un autoinyectador. Время, необходимое для введения медикаментов автоинъектором (в секундах). Czas w sekundach potrzebny do aplikacji medykamentów za pomocą autostrzykawki. @@ -351,7 +351,7 @@ Définit le temps nécessaire à l'application ou au retrait d'un garrot (en secondes). Zeit in Sekunden, die benötigt wird, um ein Tourniquet anzuwenden. Tempo in secondi richiesto per mettere/rimuovere un laccio emostatico. - 止血帯の使用/取り外しに掛かる時間 (秒) を決定します。 + 止血帯の使用/取り外しに掛かる時間。 (秒単位) Tiempo, en segundos, requerido para aplicar/quitar un torniquete. Время, необходимое для наложения/снятия жгута (в секундах). Czas w sekundach potrzebny do założenia/zdjęcia stazy. @@ -375,7 +375,7 @@ Définit le temps nécessaire à la pose d'une perfusion IV (en secondes). Zeit in Sekunden, die benötigt wird, um einen Infusionsbeutel aufzutragen. Tempo in secondi richiesto per applicare una Flebo Endovenosa. - 点滴の投与に掛かる時間 (秒) を決定します。 + 点滴の投与に掛かる時間。 (秒単位) Tiempo, en segundos, requerido para administrar una bolsa de IV. Время, необходимое для применения пакета внутривенного переливания (в секундах). Czas w sekundach potrzebny na aplikację transfuzji IV. @@ -399,7 +399,7 @@ Définit le temps nécessaire à l'application d'une attelle (en secondes). Zeit in Sekunden, die zum Anbringen einer Schiene benötigt wird. Tempo in secondi richiesto per applicare una gessatura. - 添え木の使用に掛かる時間 (秒) を決定します。 + 添え木の使用に掛かる時間。 (秒単位) TIempo, en segundos, requerido para aplicar una férula. Время, необходимое для наложения шины (в секундах). Czas w sekundach potrzebny na aplikację szyny. @@ -423,7 +423,7 @@ Définit le temps nécessaire à la mise en housse d'un corps (en secondes). Zeit in Sekunden, die benötigt wird, um einen Leichensack aufzutragen. Tempo in secondi richiesto per mettere un deceduto in una sacca per corpi. - 遺体袋の使用に掛かる時間 (秒) を決定します。 + 遺体袋の使用に掛かる時間。 (秒単位) Tiempo, en segundos, requerido para poner a un paciente en una bolsa para cuerpos. Время, необходимое для того чтобы упаковать труп в мешок (в секундах). Czas w sekundach potrzebny na spakowanie ciała do worka na ciało. @@ -438,6 +438,7 @@ Zeit zum Graben von Gräbern Tempo di scavo tomba 墓掘りの所要時間 + Время рытья могилы Time, in seconds, required to dig a grave for a body. @@ -446,7 +447,8 @@ Durée, en secondes, requise pour creuser une tombe pour un corps. Zeit (in Sekunden), die benötigt wird, um ein Grab für einen Leichnam auszuheben. Tempo in secondi richiesto per seppellire un morto. - 遺体の墓を掘るのに掛かる時間 (秒) を決定します。 + 遺体の墓を掘るのに掛かる時間。 (秒単位) + Время в секундах, необходимое для того, чтобы выкопать могилу для тела. Allow Epinephrine @@ -498,7 +500,7 @@ Controls where epinephrine can be used. - アドレナリンが使える場所を決定します。 + アドレナリンが使える場所を制御します。 Définit les lieux où l'usage d'épinéphrine est autorisé. Контролирует, где можно использовать Адреналин. Controla onde Epinefrina pode ser utilizada. @@ -564,7 +566,7 @@ Controls where a PAK can be used. - PAKが使える場所を決定します。 + PAKが使える場所を制御します。 Définit les lieux où l'usage de la trousse sanitaire est autorisé. Контролирует, где можно использовать Аптечку. Controla onde o KPS pode ser utilizado. @@ -596,7 +598,7 @@ Controls whether a PAK should be consumed after use. - PAKの使用後に消費するかどうかを決定します。 + PAKの使用後に消費するかどうかを制御します。 Définit si la trousse sanitaire doit être à usage unique. Контролирует, следует ли израсходовать Аптечку после использования. Controla se o KPS deve ser descartado/consumido após o uso. @@ -722,7 +724,7 @@ Controls where a surgical kit can be used. - 手術キットが使える場所を決定します。 + 手術キットが使える場所を制御します。 Définit les lieux où l'usage de la trousse chirurgicale est autorisé. Контролирует, где можно использовать Хирургический набор Controle onde o Kit Cirúrgico pode ser utilizado. @@ -760,6 +762,7 @@ Co powinno zostać zużyte po zastosowaniu. 봉합키트를 1회성 소모품으로 설정할 지 여부를 결정합니다. Ce qui doit être consommé après l'utilisation. + Решите, следует ли использовать набор для наложения швов в качестве одноразового расходного материала. Self Stitching @@ -772,7 +775,7 @@ Samo-zašívání Zszywanie własnych ran Selbstnähen - Зашивание своей раны + Зашитие своей раны Auto cosido 봉합키트 자가 사용 @@ -806,7 +809,7 @@ Time, in seconds, required to stitch a single wound. Définit le temps nécessaire à la suture d'une plaie (en secondes). - 縫合に掛かる時間 (秒) を決定します。 + 縫合に掛かる時間。 (秒単位) Tiempo, en segundos, requerido para suturar una única herida. Время, необходимое для зашивания одной раны (в секундах). Czas w sekundach potrzebny na zaszycie pojedyńczej rany. @@ -848,7 +851,7 @@ Allow Unconscious Body Bag Housse mortuaire - Autoriser patients inconscients - 気絶者を遺体袋に + 無意識者の遺体袋への収容許可 Permitir bolsa para cuerpos inconsciente Разрешить упаковывать пациентов без сознания в мешки для трупов Nieprzytomni w worku na ciało @@ -860,7 +863,7 @@ Enables placing an unconscious patient in a body bag. Active la possibilité de placer des patients inconscients dans les housses mortuaires.\nAttention : le cas échéant cela provoquera la mort du patient. - 無意識状態のプレイヤーを遺体袋へ入れられるかどうかを決定します。 + 無意識状態のプレイヤーを遺体袋へ入れることが出来る様にします。 Permitir colocar a un paciente inconsciente en una bolsa para cuerpos. Разрешает упаковывать пациентов без сознания в мешки для трупов. Zezwalaj na pakowanie nieprzytomnych osób do worka na ciało. @@ -878,6 +881,7 @@ Permitir cavar tumbas Autoriser le creusement de tombes 墓掘りを許可 + Разрешить рытье могил Enables digging graves to dispose of corpses. @@ -888,6 +892,7 @@ Habilita cavar tumbas para deshacerse de los cadáveres. Active la possibilité de creuser des tombes pour enterrer les cadavres. 墓を掘って死体を処理できるようになります。 + Позволяет рыть могилы для захоронения трупов. Only if dead @@ -898,6 +903,7 @@ Solo si está muerto Uniquement s'il est mort 死体のみ + Только если мертв Create Grave Markers @@ -908,6 +914,7 @@ 무덤 마커 생성 Créer des pierres tombales 墓標を作成 + Создайте надгробные знаки Enables the creation of grave markers when digging graves. @@ -918,6 +925,7 @@ 무덤을 파낼 때 무덤 마커를 표시할 수 있습니다. Active la création de pierres tombales lors de l'enterrement de cadavres. 墓を掘った際、墓標を作成できるようにします。 + Позволяет создавать надгробные знаки при рытье могил. Allow IV Transfusion @@ -949,7 +957,7 @@ Locations IV Transfusion - IV 輸液の場所制限 + IV輸液の可能な場所 Ubicación para transfusiones IV Lieux perfusions IV Места введения пакетов внутривенного переливания @@ -961,7 +969,7 @@ Controls where IV transfusions can be performed. - IV 輸液を行える場所を決定できます。 + IV 輸液を行える場所を制御します。 Controla dónde pueden ser realizadas las transfusiones IV. Définit les lieux où la pose de perfusions est autorisée. Определяет к каким частям тела разрешено применять пакеты внутренного переливания. @@ -989,7 +997,7 @@ Controls whether vanilla medical items are converted to ACE Medical items, removed only, or ignored. Legt fest, ob Standard Medic-Equipment in ACE-Equipment umgewandelt oder entfernt wird - ゲーム標準の医療アイテムをACE医療アイテムへ変換するか、削除するか、そのままにするかを決定します。 + ゲーム標準の医療アイテムをACE医療アイテムへ変換するか、削除するか、そのままにするかを制御します。 Détermine si les objets médicaux vanilla sont convertis en objets médicaux ACE, s'ils sont simplement retirés, ou s'ils sont ignorés. Определяет, что делать с ванильными медикаментами: преобразовать в медикаменты ACE, удалить или проигнорировать. Controla se itens médicos vanilla serão convertidos para itens do ACE, removidos ou ignorados. @@ -1097,7 +1105,7 @@ Controls the lifetime of litter objects, in seconds. -1 is forever. - 廃棄物の寿命を秒で決定できます。-1 にすると恒久的になります。 + 廃棄物の寿命を秒単位で制御します。-1 にすると恒久的になります。 Définit la durée d'affichage des détritus, en secondes. Durée illimitée : -1. Управляет временем жизни объектов мусора в секундах. -1 означает Навсегда. Controla o tempo de vida de objetos de lixo criados em segundos. -1 é para sempre. @@ -1255,7 +1263,7 @@ Time, in seconds, required to perform CPR on a patient. Définit le temps nécessaire à la mise en œuvre d'une RCP (en secondes). Tempo in secondi richiesto per effettuare RCP su un paziente. - 心肺蘇生(CPR)に掛かる時間 (秒) を決定します。 + 心肺蘇生(CPR)に掛かる時間。 (秒単位) Tiempo, en segundos, requerido para realizar RCP en un paciente. Время, необходимое для проведения сердечно-лёгочной реанимации (СЛР) (в секундах). Czas w sekundach jaki jest potrzebny do wykonania CPR na pacjencie. @@ -1390,7 +1398,7 @@ Définit s'il s'agit d'un véhicule sanitaire. Se o objeto será ou não um veículo médico Будет ли объект считаться медицинским транспортом. - 対象が医療車両であるかどうか。 + 車両をを医療車両として割り当てます 이 물체는 의료 차량이 됩니다. 是否使该载具为医疗载具? 是否使該載具為醫療載具? @@ -1491,7 +1499,7 @@ Est un véhicule sanitaire Orvosi jármű-e È Veicolo Medico - 医療車両に + 医療車両とする 의료 차량 是医疗载具 是醫療載具 @@ -1508,7 +1516,7 @@ Est une installation sanitaire Orvosi létesítmény-e È Struttura Medica - 医療施設に + 医療施設とする 의료시설 是医疗设施 是醫療設施 @@ -1525,7 +1533,7 @@ Définit l'objet comme étant une installation sanitaire. Egy objektum orvosi létesítményként való regisztrálása Registra un oggetto come struttura medica - オブジェクトを医療施設として割り当てる + オブジェクトを医療施設として割り当てます 물체를 의료시설로 등록합니다 指定一个物体作为医疗设施 指定一個物件作為醫療設施 @@ -2435,6 +2443,7 @@ Szew 봉합술 Suture + Нить Surgical Suture for stitching injuries. @@ -2445,6 +2454,7 @@ Szew chirurgiczny do zszywania ran. 상처를 꿰메는 수술용 봉합술. Suture chirurgicale pour suturer les blessures. + Хирургическая нить для зашивания травм. Surgical Suture for stitching injuries. @@ -2455,6 +2465,7 @@ Szew chirurgiczny do zszywania ran. 상처를 꿰메는 수술용 봉합술. Suture chirurgicale pour suturer les blessures. + Хирургическая нить для зашивания травм. Bodybag @@ -3494,6 +3505,7 @@ Nessun dolore Kein Schmerz 痛みはない + Нет боли In mild pain @@ -3558,21 +3570,53 @@ 軍用止血帶 Turnike [CAT] - - Receiving IV [%1ml] - Erhalte IV [%1ml] - Recibiendo IV [%1ml] - Принимается переливание [%1 мл] - Otrzymywanie IV [pozostało %1ml] - Transfusion : [%1 ml] - Přijímání transfúze [%1ml] - Infúzióra kötve [%1ml] - Ricevendo EV [%1ml] - Recebendo IV [%1ml] - IV [%1ml] を投与中 - IV로 [%1ml] 수혈중 - 正在接受静脉注射 [%1毫升] - 接收靜脈注射液中 [%1毫升] + + Receiving Saline IV [%1ml] + Erhalte Saline IV [%1ml] + Recibiendo Salina IV [%1ml] + Принимается физраствор [%1 мл] + Otrzymywanie soli IV [%1ml] + Transfusion de sérum salé : [%1 ml] + Přijímání soli IV [%1ml] + Saline Infúzióra kötve [%1ml] + Ricevendo Salina EV [%1ml] + Recebendo Salina IV [%1ml] + 生理食塩水 IV [%1ml] を投与中 + 생리식염수 IV로 [%1ml] 수혈중 + 正在接受生理盐水静脉注射 [%1毫升] + 接收生理鹽水靜脈注射液中 [%1毫升] + + + Receiving Blood IV [%1ml] + Erhalte Blut IV [%1ml] + Recibiendo Sangre IV [%1ml] + Принимается кровь [%1 мл] + Otrzymywanie krwi IV [%1ml] + Transfusion de sang : [%1 ml] + Přijímání krve IV [%1ml] + Vér Infúzióra kötve [%1ml] + Ricevendo Sangue EV [%1ml] + Recebendo Sangue IV [%1ml] + 血液 IV [%1ml] を投与中 + 혈액 IV로 [%1ml] 수혈중 + 正在接受血液静脉注射 [%1毫升] + 接收血液靜脈注射液中 [%1毫升] + + + Receiving Plasma IV [%1ml] + Erhalte Plasma IV [%1ml] + Recibiendo Plasma IV [%1ml] + Принимается плазма [%1 мл] + Otrzymywanie plazmy IV [%1ml] + Transfusion de plasma : [%1 ml] + Přijímání plazmy IV [%1ml] + Plazma Infúzióra kötve [%1ml] + Ricevendo Plasma EV [%1ml] + Recebendo Plasma IV [%1ml] + プラズマ IV [%1ml] を投与中 + 혈장 IV로 [%1ml] 수혈중 + 正在接受血浆静脉注射 [%1毫升] + 接收血漿靜脈注射液中 [%1毫升] No IV @@ -3582,6 +3626,7 @@ Nessuna Flebo EV Kein IV IV なし + Нет капельницы Blood Pressure @@ -4558,6 +4603,7 @@ Vücudu siyah ceset torbasına yerleştir 遺体袋 (黒) に入れる 시체를 검은 시체가방에 놓기 + Положить тело в черный мешок для тела Place body in blue bodybag @@ -4570,6 +4616,7 @@ Vücudu mavi ceset torbasına yerleştir 遺体袋 (青) に入れる 시체를 파란 시체가방에 놓기 + Положить тело в синий мешок для тела Place body in white bodybag @@ -4582,6 +4629,7 @@ Vücudu beyaz ceset torbasına yerleştir 遺体袋 (白) に入れる 시체를 흰 시체가방에 놓기 + Положить тело в белый мешок для тела Placing body in bodybag... @@ -4608,6 +4656,7 @@ Grabe ein Grab für den Leichnam Scava tomba per cadavere 墓を掘る + Выкопать могилу для тела Digging grave for body... @@ -4617,6 +4666,7 @@ Grab für Leichnam ausheben ... Scavando tomba per cadavere... 墓を掘っています + Рытьё могилы для тела... %1 has bandaged patient @@ -4787,7 +4837,7 @@ Heal fully bandaged hitpoints Lecz w pełni zabandażowane hitpointy Curar miembros totalmente vendados - Исцелять полностью перебинтованные части тела + Исцелить полностью перебинтованные части тела Curar membros totalmente enfaixados Heal fully bandaged hitpoints Cura hitpoints completamente bendati @@ -4868,6 +4918,7 @@ Überprüfe Name auf dem Grabstein Controlla nome sulla lapide 墓石の名前を確認 + Проверьте имя на надгробии Bandage Rollover @@ -4877,6 +4928,7 @@ Pansement de plaies multiples Srotolamento Bendaggi 包帯の繰り越し + Перевязка множественных ран If enabled, bandages can close different types of wounds on the same body part.\nBandaging multiple injuries will scale bandaging time accordingly. @@ -4886,6 +4938,7 @@ Si activé, les bandages peuvent fermer plusieurs types de blessures sur la même partie du corps.\nPanser de multiples blessures modifiera la durée d'application en conséquence. Se attivo, un singolo bendaggio potrà chiudere più ferite sulla stessa parte del corpo.\nBendare più ferite di conseguenza richiederà più tempo. 有効にすると、体の同じ部分にある別の種類の傷を一つの包帯で閉じることができます。\n複数の傷に包帯を巻くと、それに応じて包帯時間が変動します。 + Если эта функция включена, бинты могут закрывать различные типы ран на одной и той же части тела.\nПри перевязке нескольких повреждений время перевязки будет увеличено соответствующим образом. Bandage Effectiveness Coefficient @@ -4895,6 +4948,7 @@ Coefficient d'efficacité des bandages Coefficiente di efficacia bendaggi 包帯有効性係数 + Коэффициент эффективности повязки Determines how effective bandages are at closing wounds. @@ -4903,7 +4957,8 @@ 붕대가 상처를 치료하는 데 얼마나 효과적으로 지속되는지 결정합니다. Défini l'efficacité des bandages à refermer des plaies. Determina quanto i bendaggi sono efficaci nel chiudere le ferite. - 包帯が傷をふさぐのにどれだけ効果的かを決定します。 + 包帯が傷をふさぐのにどれだけ効果的かを定義します。 + Определяет, насколько эффективны бинты при закрытии ран. Medical Items @@ -4925,6 +4980,8 @@ Zeit-Koeffizient für Zeus Behandlungen Zeus治療時間係数 제우스 치료 시간 계수 + Коэффициент времени обработки Zeus + Coeff. de temps Multiply all treatment times with this coefficient when in Zeus. @@ -4932,6 +4989,56 @@ Dauer von Behandlungen als Zeus wird mit diesem Koeffizienten multipliziert. Zeus操作中は、すべての治療時間にこの係数を掛けます。 제우스일 때 모든 치료 시간에 이 계수를 곱합니다. + Умножьте все время лечения на этот коэффициент, когда вы находитесь в Zeus. + Coefficient de temps de traitement Zeus + + + Painkillers + Léky proti bolesti + Schmerztabellen + Болеутоляющее + Środki przeciwbólowe + Antidolorifici + Analgésicos + Analgésiques + 止痛藥 + 鎮痛剤 + 진통제 + Analgésicos + 止痛药 + Ağrı kesici + + + Administer Painkillers + Somministra Antidolorifici + Испол-ть обезболивающие + 鎮痛剤を投与 + 진통제 투여 + Administrer des analgésiques + + + Administering Painkillers... + Somministrando Antidolorifici... + Использование обезболивающего... + 鎮痛剤を投与しています・・・ + 진통제 투여 중... + Administration d'analgésiques... + + + Over-the-counter analgesic used to combat light to moderate pain experiences. + Antidolorifici senza prescrizione, usati per alleviare dolore leggero o moderato. + Безрецептурный анальгетик, используемый для борьбы с легкими и умеренными болевыми ощущениями. + 軽度から中程度の痛みに対処するために使用される市販の鎮痛薬。 + 가벼운 통증부터 중간 정도의 통증을 퇴치하는 데 사용되는 일반의약품 진통제입니다. + Analgésique sans ordonnance utilisé pour lutter contre les douleurs légères à modérées. + + + Over-the-counter analgesic used to combat light to moderate pain experiences. + Antidolorifici senza prescrizione, usati per alleviare dolore leggero o moderato. + Безрецептурный анальгетик, используемый для борьбы с легкими и умеренными болевыми ощущениями. + 軽度から中程度の痛みに対処するために使用される市販の鎮痛薬。 + 가벼운 통증부터 중간 정도의 통증을 퇴치하는 데 사용되는 일반의약품 진통제입니다. + Analgésique sans ordonnance utilisé pour lutter contre les douleurs légères à modérées. diff --git a/addons/medical_treatment/ui/painkillers_ca.paa b/addons/medical_treatment/ui/painkillers_ca.paa new file mode 100644 index 0000000000..15036c85cb Binary files /dev/null and b/addons/medical_treatment/ui/painkillers_ca.paa differ diff --git a/addons/medical_vitals/CfgWeapons.hpp b/addons/medical_vitals/CfgWeapons.hpp new file mode 100644 index 0000000000..5c6e4c9fd8 --- /dev/null +++ b/addons/medical_vitals/CfgWeapons.hpp @@ -0,0 +1,10 @@ +class CfgWeapons { + class H_HelmetB; + class H_PilotHelmetFighter_B: H_HelmetB { + GVAR(oxygenSupply) = QUOTE(vehicle _this isKindOf 'Plane' || vehicle _this isKindOf 'Helicopter'); + }; + class Vest_Camo_Base; + class V_RebreatherB: Vest_Camo_Base { + GVAR(oxygenSupply) = QUOTE(eyePos _this select 2 < 0); // will only work for sea-level water + }; +}; diff --git a/addons/medical_vitals/XEH_PREP.hpp b/addons/medical_vitals/XEH_PREP.hpp index 8f8c427751..02f1cc5f89 100644 --- a/addons/medical_vitals/XEH_PREP.hpp +++ b/addons/medical_vitals/XEH_PREP.hpp @@ -1,4 +1,6 @@ PREP(handleUnitVitals); +PREP(scanConfig); PREP(updateHeartRate); +PREP(updateOxygen); PREP(updatePainSuppress); PREP(updatePeripheralResistance); diff --git a/addons/medical_vitals/XEH_preInit.sqf b/addons/medical_vitals/XEH_preInit.sqf index b47cf6628d..8cc49805e9 100644 --- a/addons/medical_vitals/XEH_preInit.sqf +++ b/addons/medical_vitals/XEH_preInit.sqf @@ -6,4 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +#include "initSettings.inc.sqf" + +GVAR(oxygenSupplyConditionCache) = uiNamespace getVariable QGVAR(oxygenSupplyConditionCache); + ADDON = true; diff --git a/addons/medical_vitals/XEH_preStart.sqf b/addons/medical_vitals/XEH_preStart.sqf index 022888575e..78dd8ad0e3 100644 --- a/addons/medical_vitals/XEH_preStart.sqf +++ b/addons/medical_vitals/XEH_preStart.sqf @@ -1,3 +1,9 @@ #include "script_component.hpp" #include "XEH_PREP.hpp" + +GVAR(oxygenSupplyConditionCache) = createHashMap; + +call FUNC(scanConfig); + +GVAR(oxygenSupplyConditionCache) = compileFinal GVAR(oxygenSupplyConditionCache); diff --git a/addons/medical_vitals/config.cpp b/addons/medical_vitals/config.cpp index d105aa3144..290c25bc9b 100644 --- a/addons/medical_vitals/config.cpp +++ b/addons/medical_vitals/config.cpp @@ -23,5 +23,6 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgWeapons.hpp" #endif diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 683cfd34b7..c284b00701 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -31,6 +31,9 @@ if (_syncValues) then { _unit setVariable [QGVAR(lastMomentValuesSynced), CBA_missionTime]; }; +// Update SPO2 intake and usage since last update +[_unit, _deltaT, _syncValues] call FUNC(updateOxygen); + private _bloodVolume = GET_BLOOD_VOLUME(_unit) + ([_unit, _deltaT, _syncValues] call EFUNC(medical_status,getBloodVolumeChange)); _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME; diff --git a/addons/medical_vitals/functions/fnc_scanConfig.sqf b/addons/medical_vitals/functions/fnc_scanConfig.sqf new file mode 100644 index 0000000000..377b235315 --- /dev/null +++ b/addons/medical_vitals/functions/fnc_scanConfig.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: LinkIsGrim + * Cache a hashmap of all oxygen-providing items for SpO2 simulation + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No +*/ + +private _filter = toString {getText (_x >> QGVAR(oxygenSupply)) != ""}; + +{ + private _cfgRoot = configFile >> _x; + { + private _condition = compile getText (_x >> QGVAR(oxygenSupply)); + GVAR(oxygenSupplyConditionCache) set [configName _x, _condition]; + } forEach (_filter configClasses _cfgRoot); +} forEach ["CfgWeapons", "CfgGoggles"]; diff --git a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf index 9ffc52d663..187a8ffe58 100644 --- a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf +++ b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf @@ -37,6 +37,7 @@ if IN_CRDC_ARRST(_unit) then { if (_bloodVolume > BLOOD_VOLUME_CLASS_4_HEMORRHAGE) then { GET_BLOOD_PRESSURE(_unit) params ["_bloodPressureL", "_bloodPressureH"]; private _meanBP = (2/3) * _bloodPressureH + (1/3) * _bloodPressureL; + private _spo2 = GET_SPO2(_unit); private _painLevel = GET_PAIN_PERCEIVED(_unit); private _targetBP = 107; @@ -51,8 +52,11 @@ if IN_CRDC_ARRST(_unit) then { if (_painLevel > 0.2) then { _targetHR = _targetHR max (80 + 50 * _painLevel); }; + // Increase HR to compensate for low blood oxygen + // Increase HR to compensate for higher oxygen demand (e.g. running, recovering from sprint) + private _oxygenDemand = _unit getVariable [VAR_OXYGEN_DEMAND, 0]; + _targetHR = _targetHR + ((97 - _spo2) * 2) + (_oxygenDemand * -1000); _targetHR = (_targetHR + _hrTargetAdjustment) max 0; - _hrChange = round(_targetHR - _heartRate) / 2; } else { _hrChange = -round(_heartRate / 10); diff --git a/addons/medical_vitals/functions/fnc_updateOxygen.sqf b/addons/medical_vitals/functions/fnc_updateOxygen.sqf new file mode 100644 index 0000000000..f2c0f68f71 --- /dev/null +++ b/addons/medical_vitals/functions/fnc_updateOxygen.sqf @@ -0,0 +1,75 @@ +#include "..\script_component.hpp" +/* + * Author: Brett Mayson + * Update the oxygen levels + * + * Arguments: + * 0: The Unit + * 1: Time since last update + * 2: Sync value? + * + * ReturnValue: + * Current SPO2 + * + * Example: + * [player, 1, false] call ace_medical_vitals_fnc_updateOxygen + * + * Public: No + */ + +params ["_unit", "_deltaT", "_syncValue"]; + +if (!GVAR(simulateSpO2)) exitWith {}; // changing back to default is handled in initSettings.inc.sqf + +#define IDEAL_PPO2 0.255 + +private _current = GET_SPO2(_unit); +private _heartRate = GET_HEART_RATE(_unit); + +private _altitude = EGVAR(common,mapAltitude) + ((getPosASL _unit) select 2); +private _po2 = if (missionNamespace getVariable [QEGVAR(weather,enabled), false]) then { + private _temperature = _altitude call EFUNC(weather,calculateTemperatureAtHeight); + private _pressure = _altitude call EFUNC(weather,calculateBarometricPressure); + [_temperature, _pressure, EGVAR(weather,currentHumidity)] call EFUNC(weather,calculateOxygenDensity) +} else { + // Rough approximation of the partial pressure of oxygen in the air + 0.25725 * (_altitude / 1000 + 1) +}; + +private _oxygenSaturation = (IDEAL_PPO2 min _po2) / IDEAL_PPO2; + +// Check gear for oxygen supply +[goggles _unit, headgear _unit, vest _unit] findIf { + _x in GVAR(oxygenSupplyConditionCache) && + {ACE_player call (GVAR(oxygenSupplyConditionCache) get _x)} && + { // Will only run this if other conditions are met due to lazy eval + _oxygenSaturation = 1; + _po2 = IDEAL_PPO2; + true + } +}; + +// Base oxygen consumption rate +private _negativeChange = BASE_OXYGEN_USE; + +// Fatigue & exercise will demand more oxygen +// Assuming a trained male in midst of peak exercise will have a peak heart rate of ~180 BPM +// Ref: https://academic.oup.com/bjaed/article-pdf/4/6/185/894114/mkh050.pdf table 2, though we don't take stroke volume change into account +if (_unit == ACE_player && {missionNamespace getVariable [QEGVAR(advanced_fatigue,enabled), false]}) then { + _negativeChange = _negativeChange - ((1 - EGVAR(advanced_fatigue,aeReservePercentage)) * 0.1) - ((1 - EGVAR(advanced_fatigue,anReservePercentage)) * 0.05); +}; + +// Effectiveness of capturing oxygen +// increases slightly as po2 starts lowering +// but falls off quickly as po2 drops further +private _capture = 1 max ((_po2 / IDEAL_PPO2) ^ (-_po2 * 3)); +private _positiveChange = _heartRate * 0.00368 * _oxygenSaturation * _capture; + +private _breathingEffectiveness = 1; + +private _rateOfChange = _negativeChange + (_positiveChange * _breathingEffectiveness); + +private _spo2 = (_current + (_rateOfChange * _deltaT)) max 0 min 100; + +_unit setVariable [VAR_OXYGEN_DEMAND, _negativeChange - BASE_OXYGEN_USE]; +_unit setVariable [VAR_SPO2, _spo2, _syncValue]; diff --git a/addons/medical_vitals/initSettings.inc.sqf b/addons/medical_vitals/initSettings.inc.sqf new file mode 100644 index 0000000000..db762d2c52 --- /dev/null +++ b/addons/medical_vitals/initSettings.inc.sqf @@ -0,0 +1,15 @@ +[ + QGVAR(simulateSpO2), + "CHECKBOX", + [LSTRING(simulateSpO2_DisplayName), LSTRING(simulateSpO2_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + true, + 1, + { + if (_this) exitWith {}; // skip if true + { + _x setVariable [VAR_OXYGEN_DEMAND, 0, true]; + _x setVariable [VAR_SPO2, DEFAULT_SPO2, true]; + } forEach (allUnits select {local _x}) + } // reset oxygen demand on setting change +] call CBA_fnc_addSetting; diff --git a/addons/medical_vitals/script_component.hpp b/addons/medical_vitals/script_component.hpp index 3bfb4bcc26..1064ebc52c 100644 --- a/addons/medical_vitals/script_component.hpp +++ b/addons/medical_vitals/script_component.hpp @@ -16,3 +16,5 @@ #include "\z\ace\addons\medical_engine\script_macros_medical.hpp" #include "\z\ace\addons\main\script_macros.hpp" + +#define BASE_OXYGEN_USE -0.25 diff --git a/addons/medical_vitals/stringtable.xml b/addons/medical_vitals/stringtable.xml new file mode 100644 index 0000000000..eb0080bd07 --- /dev/null +++ b/addons/medical_vitals/stringtable.xml @@ -0,0 +1,30 @@ + + + + + Vitals + Vitais + Parametri Vitali + Жизненно-важные органы + バイタル + 생명 + Paramètres vitaux + + + Enable SpO2 Simulation + Abilita simulazione SpO2 + Включить имитацию SpO2 + SpO2シミュレーションを有効化 + 산소포화도 시뮬레이션 활성화 + Activer la simulation de la SpO2 + + + Enables oxygen saturation simulation, providing variable heart rate and oxygen demand based on physical activity and altitude. Required for Airway Management. + Abilita la simulazione della saturazione di ossigeno, alterando la frequenza cardiaca e consumo di ossigeno in funzione dell'attività fisica e l'altitudine. Richiesto per la gestione delle vie aeree. + Позволяет имитировать насыщение кислородом, обеспечивая переменную частоту сердечных сокращений и потребность в кислороде в зависимости от физической активности и высоты над уровнем моря. Требуется для управления дыхательными путями. + 酸素飽和度シミュレーションを有効にし、身体活動や標高に基づいて変動する心拍数と酸素要求量の機能を提供します。 気道管理に必要です。 + 산소포화도 시뮬레이션을 활성화하여 신체 활동과 고도에 따라 다양한 심박수와 산소 요구량을 제공합니다. 기도 관리에 필요합니다. + Permet de simuler la saturation en oxygène, de modifier la fréquence cardiaque et la consommation d'oxygène en fonction de l'activité physique et de l'altitude. Nécessaire pour la gestion des voies respiratoires. + + + diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index 8a5db92e0b..c17914ad4b 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -35,7 +35,7 @@ private _closeCode = { }, ""] call CBA_fnc_addKeybind; //Add Eventhandler: -[QEGVAR(vector,rangefinderData), {_this call FUNC(recieveRangefinderData)}] call CBA_fnc_addEventHandler; +[QEGVAR(vector,rangefinderData), LINKFUNC(recieveRangefinderData)] call CBA_fnc_addEventHandler; //Global Variables to default: GVAR(gpsPositionASL) = [0,0,0]; diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 30a0c6ad6e..86415a1914 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -60,7 +60,7 @@ if (GVAR(currentApplicationPage) == 1) then { _size = 32 * _mapSize; { _x params ["_wpName", "_wpPos"]; - private _alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5}; + private _alpha = [0.5, 1] select (_forEachIndex == GVAR(currentWaypoint)); _theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ]; } forEach _waypoints; }; diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index c8e0b16d34..786cb15b95 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -447,7 +447,7 @@ Mennyi térképadatot tartalmaz a MicroDAGR Сколько данных должно отображаться на карте MicroDAGR Quanti dati cartografici sono mostrati sulla mappa del MicroDAGR - MicroDAGR で表示する地図情報を決定します + MicroDAGR で表示される地図の情報量 얼마나 많은 데이터를 마이크로DAGR가 보여주는지를 결정합니다 有多少地图数据会显示在微型军用 GPS 接收器 有多少地圖數據會顯示在微型軍用GPS接收器 @@ -519,7 +519,7 @@ Controls how precise the waypointdistance can be displayed Legt die Genauigkeit der Entfernung von Wegpunkten fest Controlla quanto è precisa la distanza indicata dal waypoint - 表示されるウェイポイントの精度を設定します + ウェイポイント距離の表示精度を制御します。 Kontroluje jak precyzyjnie może być wyświetlany dystans PT Управляет точностью отображения расстояний маршрутных точек Controla o quão preciso pode exibir o waypoint de distância @@ -589,7 +589,7 @@ Meghatárroza a MicroDAGR objektumok térképének tartalmát. A kevesebb adat korlátozza a térképnézeti módot az eszközön. Контролирует, сколько данных должно отображаться на карте устройств MicroDAGR. Ограничивает объем отображаемых данных на миникарте. Controlla quanti dati cartografici vengono caricati sui MicroDAGR. Meno dati permetteranno la visualizzazione di meno informazioni sulla minimappa. - アイテム上で表示されるデータ量を決定します。設定を減らすと地図上での情報が少なくなります。 + microDAGRの項目に入力されるデータの量を制御します。データを少なくすると、マップビューが制限され、ミニマップの表示量が少なくなります。 마이크로DAGR에 얼마나 많은 데이터가 들어있는지 정합니다. 적을 수록 지도상에도 비춰지는게 적어집니다. 设定有多少数据会显示在微型军用 GPS 接收器上。这些资料的多寡会反映在迷你地图的显示上。 設定有多少數據會顯示在微型軍用GPS接收器上。這些資料的多寡會反映在迷你地圖的顯示上。 diff --git a/addons/minedetector/XEH_postInit.sqf b/addons/minedetector/XEH_postInit.sqf index 0b8a521155..77f2f6761c 100644 --- a/addons/minedetector/XEH_postInit.sqf +++ b/addons/minedetector/XEH_postInit.sqf @@ -12,8 +12,8 @@ private _detectableClasses = call (uiNamespace getVariable [QGVAR(detectableClas } forEach _detectableClasses; TRACE_1("built cache",count allVariables GVAR(detectableClasses)); -[QGVAR(enableDetector), FUNC(enableDetector)] call CBA_fnc_addEventHandler; -[QGVAR(disableDetector), FUNC(disableDetector)] call CBA_fnc_addEventHandler; +[QGVAR(enableDetector), LINKFUNC(enableDetector)] call CBA_fnc_addEventHandler; +[QGVAR(disableDetector), LINKFUNC(disableDetector)] call CBA_fnc_addEventHandler; // Shows detector and mine posistions in 3d when debug is on #ifdef DEBUG_MODE_FULL diff --git a/addons/minedetector/functions/fnc_enableDetector.sqf b/addons/minedetector/functions/fnc_enableDetector.sqf index b673176086..55b58dcf3a 100644 --- a/addons/minedetector/functions/fnc_enableDetector.sqf +++ b/addons/minedetector/functions/fnc_enableDetector.sqf @@ -31,4 +31,4 @@ if (_unit == ACE_player) then { [QGVAR(detectorEnabled), [_unit, _detectorType]] call CBA_fnc_localEvent; private _config = [_detectorType] call FUNC(getDetectorConfig); -[FUNC(detectorLoop), 0.05, [_unit, _detectorType, _config, CBA_missionTime - 0.25]] call CBA_fnc_addPerFrameHandler; +[LINKFUNC(detectorLoop), 0.05, [_unit, _detectorType, _config, CBA_missionTime - 0.25]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/minedetector/functions/fnc_getDetectedObject.sqf b/addons/minedetector/functions/fnc_getDetectedObject.sqf index 6827e59c99..810e4d4ff4 100644 --- a/addons/minedetector/functions/fnc_getDetectedObject.sqf +++ b/addons/minedetector/functions/fnc_getDetectedObject.sqf @@ -49,7 +49,7 @@ private _distance = -1; if (_isDetectable && {!isNull _x}) exitWith { _distance = _detectorPointAGL distance _x; _mine = _x; - TRACE_3("return", _isDetectable, _mine, _distance); + TRACE_3("return",_isDetectable,_mine,_distance); }; } forEach _nearestObjects; diff --git a/addons/missileguidance/CfgEventhandlers.hpp b/addons/missileguidance/CfgEventhandlers.hpp index 449681e8df..a288a93399 100644 --- a/addons/missileguidance/CfgEventhandlers.hpp +++ b/addons/missileguidance/CfgEventhandlers.hpp @@ -7,13 +7,13 @@ class Extended_PreStart_EventHandlers { class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_pre_init)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_SCRIPT(XEH_post_init)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/missileguidance/XEH_post_init.sqf b/addons/missileguidance/XEH_postInit.sqf similarity index 76% rename from addons/missileguidance/XEH_post_init.sqf rename to addons/missileguidance/XEH_postInit.sqf index cc09b1f0ac..eb0fb60abf 100644 --- a/addons/missileguidance/XEH_post_init.sqf +++ b/addons/missileguidance/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -[QGVAR(handoff), {_this call FUNC(handleHandoff)}] call CBA_fnc_addEventHandler; +[QGVAR(handoff), LINKFUNC(handleHandoff)] call CBA_fnc_addEventHandler; ["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), { diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_preInit.sqf similarity index 100% rename from addons/missileguidance/XEH_pre_init.sqf rename to addons/missileguidance/XEH_preInit.sqf diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index 6ddb60d21b..b690ab2075 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -69,5 +69,5 @@ switch (_attackProfileStateParams select 0) do { }; }; -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index d7092a924d..f1f360e403 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -58,7 +58,7 @@ switch( (_attackProfileStateParams select 0) ) do { private _cruisAlt = 140; if (_distanceShooterToTarget < 1250) then { _cruisAlt = 140 * (_distanceShooterToTarget/1250); - TRACE_1("_cruisAlt", _cruisAlt); + TRACE_1("_cruisAlt",_cruisAlt); }; if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { if (_cruisAlt < 140) then { @@ -72,7 +72,7 @@ switch( (_attackProfileStateParams select 0) ) do { }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - TRACE_1("", ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ); + TRACE_1("",((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2)); if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { @@ -86,5 +86,5 @@ switch( (_attackProfileStateParams select 0) ) do { }; }; -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 23476ec46c..e346b16eb6 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -30,7 +30,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _addHeight = [0,0,0]; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 132af330c3..0620e9e3c0 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -37,7 +37,7 @@ private _adjustTime = 1; if (accTime > 0) then { _adjustTime = 1/accTime; _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); - TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); + TRACE_4("Adjust timing",1/accTime,_adjustTime,_runtimeDelta,(_runtimeDelta / TIMESTEP_FACTOR)); } else { _adjustTime = 0; }; @@ -89,8 +89,8 @@ if ((_minDeflection != 0 || {_maxDeflection != 0}) && {_profileAdjustedTargetPos }; private _finalAdjustVector = [_yaw, _roll, _pitch]; - TRACE_3("", _pitch, _yaw, _roll); - TRACE_3("", _targetVector, _adjustVector, _finalAdjustVector); + TRACE_3("",_pitch,_yaw,_roll); + TRACE_3("",_targetVector,_adjustVector,_finalAdjustVector); if (accTime > 0) then { private _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; diff --git a/addons/missileguidance/functions/fnc_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf index 9c6e299d01..785071da01 100644 --- a/addons/missileguidance/functions/fnc_handleHandoff.sqf +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -19,4 +19,4 @@ params ["_target", "_args"]; if (isNil "_target" || {isNull _target} || {!local _target} ) exitWith { false }; -[FUNC(guidancePFH), 0, _args] call CBA_fnc_addPerFrameHandler; +[LINKFUNC(guidancePFH), 0, _args] call CBA_fnc_addPerFrameHandler; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 1c964c5113..18eaf2a7c7 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -71,14 +71,14 @@ if (isNil "_target") then { if (!isPlayer _shooter) then { // This was an AI shot, lets still guide it on the AI target _target = _shooter getVariable [QGVAR(vanilla_target), nil]; - TRACE_1("Detected AI Shooter!", _target); + TRACE_1("Detected AI Shooter!",_target); } else { private _canUseLock = getNumber (_config >> "canVanillaLock"); // @TODO: Get vanilla target if (_canUseLock > 0 || difficulty < 1) then { private _vanillaTarget = cursorTarget; - TRACE_1("Using Vanilla Locking", _vanillaTarget); + TRACE_1("Using Vanilla Locking",_vanillaTarget); if (!isNil "_vanillaTarget") then { _target = _vanillaTarget; }; @@ -145,7 +145,7 @@ if (_onFiredFunc != "") then { // _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState"]; // _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; -[FUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; +[LINKFUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; /* Clears locking settings diff --git a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf b/addons/missileguidance/functions/fnc_seekerType_ARH.sqf index 20571e3d65..54e487a9a0 100644 --- a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_ARH.sqf @@ -72,7 +72,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { }; _nearestObjects = _nearestObjects select { !isNull _x }; // Select closest object to the expected position to be the current radar target - if ((count _nearestObjects) <= 0) exitWith { + if (_nearestObjects isEqualTo []) exitWith { _projectile setMissileTarget objNull; _searchPos }; @@ -117,4 +117,3 @@ if !(isNull _target) then { _launchParams set [0, _target]; _expectedTargetPos - diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 7fc30fb30b..bac01d05b4 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -34,12 +34,12 @@ private _losOkay = false; if (_angleOkay) then { _losOkay = [_projectile, _target] call FUNC(checkLos); }; -TRACE_2("", _angleOkay, _losOkay); +TRACE_2("",_angleOkay,_losOkay); // Can't see target, return [0,0,0] and let doSeekerSearch handle it if (!_angleOkay || !_losOkay) exitWith {[0,0,0]}; -TRACE_2("", _target, _foundTargetPos); +TRACE_2("",_target,_foundTargetPos); // @TODO: Configurable lead for seekers private _projectileSpeed = (vectorMagnitude velocity _projectile); private _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index 4b74d0f7e3..a16c58ce5f 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -27,6 +27,6 @@ _laserParams params ["_code", "_wavelengthMin", "_wavelengthMax"]; private _laserResult = [(getPosASL _projectile), (velocity _projectile), _seekerAngle, _seekerMaxRange, [_wavelengthMin, _wavelengthMax], _code, _projectile] call EFUNC(laser,seekerFindLaserSpot); private _foundTargetPos = _laserResult select 0; -TRACE_1("Search", _laserResult); +TRACE_1("Search",_laserResult); _foundTargetPos; diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 63465a6588..88e2ba02d5 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -55,11 +55,9 @@ private _missionRoot = str missionConfigFile select [0, count str missionConfigF ERROR_1("Ambient Sounds: Sound ""%1"" not found.",_x); }; }; +} forEach _splittedList; - false -} count _splittedList; - -if (count _ambianceSounds == 0) exitWith {}; +if (_ambianceSounds isEqualTo []) exitWith {}; { if ((_x find ".") == -1) then { _ambianceSounds set [_forEachIndex, _x + ".wss"]; @@ -82,7 +80,7 @@ TRACE_1("",_ambianceSounds); private _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; // Check if there are enough players to even start playing this sound. - if (count _allUnits > 0) then { + if (_allUnits isNotEqualTo []) then { // find the position from which we are going to play this sound from. private _newPosASL = if (_followPlayers) then { // Select a target unit at random. diff --git a/addons/mk6mortar/CfgMagazines.hpp b/addons/mk6mortar/CfgMagazines.hpp index 0d5c1d5703..e0626479c4 100644 --- a/addons/mk6mortar/CfgMagazines.hpp +++ b/addons/mk6mortar/CfgMagazines.hpp @@ -1,10 +1,11 @@ -class cfgMagazines { +class CfgMagazines { class 8Rnd_82mm_Mo_shells; class ACE_1Rnd_82mm_Mo_HE: 8Rnd_82mm_Mo_shells { count = 1; scope = 2; scopeCurator = 2; EGVAR(arsenal,hide) = -1; + type = 256; author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine_HE_displayName); displayNameShort = ""; @@ -19,6 +20,7 @@ class cfgMagazines { scope = 2; scopeCurator = 2; EGVAR(arsenal,hide) = -1; + type = 256; author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine_Smoke_displayName); displayNameShort = ""; @@ -33,6 +35,7 @@ class cfgMagazines { scope = 2; scopeCurator = 2; EGVAR(arsenal,hide) = -1; + type = 256; author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine_Illum_displayName); displayNameShort = ""; @@ -47,6 +50,7 @@ class cfgMagazines { scope = 2; scopeCurator = 2; EGVAR(arsenal,hide) = -1; + type = 256; author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine_HE_Guided_displayName); displayNameShort = ""; @@ -61,6 +65,7 @@ class cfgMagazines { scope = 2; scopeCurator = 2; EGVAR(arsenal,hide) = -1; + type = 256; author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine_HE_LaserGuided_displayName); displayNameShort = ""; diff --git a/addons/mk6mortar/XEH_postInit.sqf b/addons/mk6mortar/XEH_postInit.sqf index 9f24a12a3b..280e16cf79 100644 --- a/addons/mk6mortar/XEH_postInit.sqf +++ b/addons/mk6mortar/XEH_postInit.sqf @@ -1,16 +1,17 @@ #include "script_component.hpp" if (hasInterface) then { - ["ace_infoDisplayChanged", FUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler; + #include "initKeybinds.inc.sqf" + ["ace_infoDisplayChanged", LINKFUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler; }; ["CBA_settingsInitialized", { TRACE_4("CBA_settingsInitialized",GVAR(airResistanceEnabled),GVAR(allowComputerRangefinder),GVAR(allowCompass),GVAR(useAmmoHandling)); - ["vehicle", FUNC(handlePlayerVehicleChanged), true] call CBA_fnc_addPlayerEventHandler; + ["vehicle", LINKFUNC(handlePlayerVehicleChanged), true] call CBA_fnc_addPlayerEventHandler; if (!GVAR(airResistanceEnabled)) exitWith {}; if (EGVAR(artillerytables,advancedCorrections)) exitWith { TRACE_1("defer firedEH to artillerytables",_this); }; - ["Mortar_01_base_F", "fired", {call FUNC(handleFired)}] call CBA_fnc_addClassEventHandler; + ["Mortar_01_base_F", "fired", LINKFUNC(handleFired)] call CBA_fnc_addClassEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf b/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf index 3356e91c11..663afa2cc7 100644 --- a/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf +++ b/addons/mk6mortar/functions/fnc_csw_getProxyWeapon.sqf @@ -55,7 +55,7 @@ if (_proxyWeaponNeeded || GVAR(useAmmoHandling)) then { }; }; } else { - WARNING_1("unknown mag %1", _xMag); + WARNING_1("unknown mag %1",_xMag); }; }; } forEach (magazinesAllTurrets _mortar); diff --git a/addons/mk6mortar/functions/fnc_handleFired.sqf b/addons/mk6mortar/functions/fnc_handleFired.sqf index c09c96f777..f2979d0e4e 100644 --- a/addons/mk6mortar/functions/fnc_handleFired.sqf +++ b/addons/mk6mortar/functions/fnc_handleFired.sqf @@ -24,11 +24,11 @@ params ["_vehicle", "", "", "", "", "", "_projectile"]; // Large enough distance to not simulate any wind deflection -if (_vehicle distance ACE_player > 8000) exitWith {false}; +if (_vehicle distance ACE_player > 8000) exitWith {}; //AI will have no clue how to use: private _shooterMan = gunner _vehicle; -if (!([_shooterMan] call EFUNC(common,isPlayer))) exitWith {false}; +if (!([_shooterMan] call EFUNC(common,isPlayer))) exitWith {}; //Calculate air density: private _altitude = (getPosASL _vehicle) select 2; diff --git a/addons/mk6mortar/initKeybinds.inc.sqf b/addons/mk6mortar/initKeybinds.inc.sqf new file mode 100644 index 0000000000..0e3a53c1d9 --- /dev/null +++ b/addons/mk6mortar/initKeybinds.inc.sqf @@ -0,0 +1,15 @@ +#include "\a3\ui_f\hpp\defineDIKCodes.inc" + +["ACE3 Equipment", QGVAR(rangetable_action), LLSTRING(rangetable_action), { + if ( + !([ACE_player, "ACE_RangeTable_82mm"] call EFUNC(common,hasItem)) || + !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) + ) exitWith {false}; + + // Close previously opened dialogs + closeDialog 0; + + // Statement + [] call FUNC(rangeTableOpen); + true +}] call CBA_fnc_addKeybind; // Unbound diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index bdc6a9cc40..c391916f19 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -26,7 +26,7 @@ _function = missionNamespace getVariable _function; }; if (_isSingular && {_logicType in _uniqueModulesHandled}) then { //ToDo: should this be an exit? - WARNING_1("Module [%1] - More than 1 singular module placed", _logicType); + WARNING_1("Module [%1] - More than 1 singular module placed",_logicType); }; if (_isSingular) then {_uniqueModulesHandled pushBack _logicType;}; diff --git a/addons/movement/CfgEventHandlers.hpp b/addons/movement/CfgEventHandlers.hpp index 2608d0260b..f6503c2479 100644 --- a/addons/movement/CfgEventHandlers.hpp +++ b/addons/movement/CfgEventHandlers.hpp @@ -15,9 +15,3 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; - -class Extended_DisplayLoad_EventHandlers { - class RscDisplayInventory { - ADDON = QUOTE(_this call FUNC(inventoryDisplayLoad)); - }; -}; diff --git a/addons/movement/XEH_PREP.hpp b/addons/movement/XEH_PREP.hpp index ceafa7f5dc..36fe97880d 100644 --- a/addons/movement/XEH_PREP.hpp +++ b/addons/movement/XEH_PREP.hpp @@ -3,4 +3,3 @@ PREP(canClimb); PREP(climb); PREP(handleClimb); PREP(handleVirtualMass); -PREP(inventoryDisplayLoad); diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index f64b92603b..4d7cc5ba12 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -3,8 +3,8 @@ if (!hasInterface) exitWith {}; -["unit", FUNC(handleVirtualMass)] call CBA_fnc_addPlayerEventHandler; -["loadout", FUNC(handleVirtualMass)] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handleVirtualMass)] call CBA_fnc_addPlayerEventHandler; +["loadout", LINKFUNC(handleVirtualMass)] call CBA_fnc_addPlayerEventHandler; ["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), { // Conditions: canInteract diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index aa9c900390..428cf037d5 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -21,7 +21,7 @@ * Public: No */ -TRACE_1("drawName:", _this); +TRACE_1("drawName:",_this); params ["", "_target", "", "_heightOffset"]; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index 7e9d156014..f831a3209f 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -138,8 +138,7 @@ if (_enabledTagsNearby) then { [ACE_player, _target, _alpha, _distance * 0.026, _drawName, _drawRank, _drawSoundwave] call FUNC(drawNameTagIcon); }; }; - nil - } count _targets; + } forEach _targets; }; END_COUNTER(GVAR(onDraw3d)); diff --git a/addons/nightvision/ACE_Arsenal_Stats.hpp b/addons/nightvision/ACE_Arsenal_Stats.hpp index 0b42d136f6..e6d2a87c89 100644 --- a/addons/nightvision/ACE_Arsenal_Stats.hpp +++ b/addons/nightvision/ACE_Arsenal_Stats.hpp @@ -3,7 +3,7 @@ class EGVAR(arsenal,stats) { class GVAR(generation): statBase { scope = 2; priority = 1.6; - condition = QUOTE('nvg' in (getArray ((_this select 1) >> 'visionMode') apply {toLower _x})); + condition = QUOTE('nvg' in (getArray ((_this select 1) >> 'visionMode') apply {toLowerANSI _x})); displayName = CSTRING(NVGeneration); showText = 1; textStatement = QUOTE(call FUNC(statTextStatement_NVGeneration)); diff --git a/addons/nightvision/XEH_preInit.sqf b/addons/nightvision/XEH_preInit.sqf index 894773534a..8251bf8baf 100644 --- a/addons/nightvision/XEH_preInit.sqf +++ b/addons/nightvision/XEH_preInit.sqf @@ -8,4 +8,7 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" +// #9781 - register effects layer ASAP +QGVAR(display) cutText ["", "PLAIN"]; + ADDON = true; diff --git a/addons/nightvision/functions/fnc_onCameraViewChanged.sqf b/addons/nightvision/functions/fnc_onCameraViewChanged.sqf index 2cbec4d16e..6f03c2a3af 100644 --- a/addons/nightvision/functions/fnc_onCameraViewChanged.sqf +++ b/addons/nightvision/functions/fnc_onCameraViewChanged.sqf @@ -23,7 +23,7 @@ TRACE_2("onCameraViewChanged",_unit,_cameraView); call FUNC(refreshGoggleType); if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { - if ((vehicle _unit == _unit) + if ((isNull objectParent _unit) || {isTurnedOut _unit} || {!([_unit] call EFUNC(common,hasHatch)) && {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))} diff --git a/addons/nightvision/functions/fnc_onFiredPlayer.sqf b/addons/nightvision/functions/fnc_onFiredPlayer.sqf index 0be73062d2..5bc7ff621e 100644 --- a/addons/nightvision/functions/fnc_onFiredPlayer.sqf +++ b/addons/nightvision/functions/fnc_onFiredPlayer.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; -TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile); +TRACE_7("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if ((!GVAR(running)) || {!GVAR(shutterEffects)} @@ -55,7 +55,7 @@ _visibleFire = _visibleFireCoef * _visibleFire; if (_ammo isKindOf "BulletBase") then { _visibleFire = _visibleFire min 5; // Prevent every shot from triggering with HMG }; -TRACE_1("final", _visibleFire); +TRACE_1("final",_visibleFire); if (_visibleFire <= 1.5) exitWith {}; if ((random (linearConversion [1, 4, GVAR(nvgGeneration), 10, 20])) > _visibleFire) exitWith {}; diff --git a/addons/nightvision/functions/fnc_onVisionModeChanged.sqf b/addons/nightvision/functions/fnc_onVisionModeChanged.sqf index 1913454f3f..8086b2d1a0 100644 --- a/addons/nightvision/functions/fnc_onVisionModeChanged.sqf +++ b/addons/nightvision/functions/fnc_onVisionModeChanged.sqf @@ -21,7 +21,7 @@ TRACE_2("onVisionModeChanged",_unit,_visionMode); // Handle disableNVGsWithSights setting: if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { - if ((vehicle _unit == _unit) + if ((isNull objectParent _unit) || {isTurnedOut _unit} || {!([_unit] call EFUNC(common,hasHatch)) && {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))} diff --git a/addons/nightvision/functions/fnc_pfeh.sqf b/addons/nightvision/functions/fnc_pfeh.sqf index ad484d097e..dbd101631c 100644 --- a/addons/nightvision/functions/fnc_pfeh.sqf +++ b/addons/nightvision/functions/fnc_pfeh.sqf @@ -36,7 +36,7 @@ if (EGVAR(common,OldIsCamera)) exitWith { }; }; if (!GVAR(running)) then { - TRACE_1("Un-Pausing", GVAR(paused)); + TRACE_1("Un-Pausing",GVAR(paused)); GVAR(running) = true; [true] call FUNC(setupDisplayEffects); [] call FUNC(refreshGoggleType); diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index 7414e58d02..ccfbd017b6 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -51,7 +51,7 @@ if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) then { if (isArray (_config >> QGVAR(colorPreset))) then {_preset = getArray (_config >> QGVAR(colorPreset));}; }; - TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope, but no good way to detect that) + TRACE_1("source: hmd",GVAR(playerHMD)); // Source is player's HMD (or possibly a NVG scope,but no good way to detect that) private _config = configFile >> "CfgWeapons" >> GVAR(playerHMD); if (!isClass _config) exitWith {}; diff --git a/addons/nightvision/functions/fnc_setupDisplayEffects.sqf b/addons/nightvision/functions/fnc_setupDisplayEffects.sqf index bb7067689c..6e480c1ca6 100644 --- a/addons/nightvision/functions/fnc_setupDisplayEffects.sqf +++ b/addons/nightvision/functions/fnc_setupDisplayEffects.sqf @@ -48,10 +48,9 @@ if (GVAR(fogScaling) > 0) then { }; }; -// Note: Using BIS_fnc_rscLayer because of bug with string syntax - https://feedback.bistudio.com/T120768 -(QGVAR(display) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; // Cleanup Old Display +QGVAR(display) cutText ["", "PLAIN"]; // Cleanup Old Display if (_activated) then { // Create New Display - (QGVAR(display) call BIS_fnc_rscLayer) cutRsc [QGVAR(title), "PLAIN", 0, false, false]; // draw under HUD + QGVAR(display) cutRsc [QGVAR(title), "PLAIN", 0, false, false]; // draw under HUD }; // Cleanup Old PP Effects diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index f3644f9045..e1345ec44e 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -22,7 +22,7 @@ JVN (Gen1, marron) ПНВ (Gen1, Коричневый) Visore Notturno (Gen1, Marrone) - 暗視装置 (第1世代、ブラウン) + NVゴーグル (第1世代、ブラウン) Gogle noktowizyjne (Gen 1, Brązowe) NS-Brille (1. Gen., braun) 夜视仪(一代,棕色) @@ -34,7 +34,7 @@ JVN (Gen1, noires) ПНВ (Gen1, Чёрный) Visore Notturno (Gen1, Nero) - 暗視装置 (第1世代、ブラック) + NVゴーグル (第1世代、ブラック) Gogle noktowizyjne (Gen 1, Czarne) NS-Brille (1. Gen., schwarz) 夜视仪(一代,黑色) @@ -46,7 +46,7 @@ JVN (Gen1, vertes) ПНВ (Gen1, Зелёный) Visore Notturno (Gen1, Verde) - 暗視装置 (第1世代、グリーン) + NVゴーグル (第1世代、グリーン) Gogle noktowizyjne (Gen 1, Zielone) NS-Brille (1. Gen., grün) 夜视仪(一代,绿色) @@ -58,7 +58,7 @@ JVN (Gen2, marron) ПНВ (Gen2, Коричневый) Visore Notturno (Gen2, Marrone) - 暗視装置 (第2世代、ブラウン) + NVゴーグル (第2世代、ブラウン) Gogle noktowizyjne (Gen 2, Brązowe) NS-Brille (2. Gen., braun) 夜视仪(二代,棕色) @@ -70,7 +70,7 @@ JVN (Gen2, noires) ПНВ (Gen2, Чёрный) Visore Notturno (Gen2, Nero) - 暗視装置 (第2世代、ブラック) + NVゴーグル (第2世代、ブラック) Gogle noktowizyjne (Gen 2, Czarne) NS-Brille (2. Gen., schwarz) 夜视仪(二代,黑色) @@ -82,7 +82,7 @@ NV Goggles (Gen2, vertes) ПНВ (Gen2, Зелёный) Visore Notturno (Gen2, Verde) - 暗視装置 (第2世代、グリーン) + NVゴーグル (第2世代、グリーン) Gogle noktowizyjne (Gen 2, Zielone) NS-Brille (2. Gen., grün) 夜视仪(二代,绿色) @@ -100,7 +100,7 @@ ПНВ (Gen3) Gafas de visión nocturna (Gen3) Éjjellátó szemüveg (3. Gen.) - 暗視装置 (第3世代) + NVゴーグル (第3世代) 야투경 (3세대) 夜视仪(三代) 夜視鏡 (三代) @@ -117,7 +117,7 @@ ПНВ (Gen3, Коричневый) Gafas de visión nocturna (Gen3, Marrón) Éjjellátó szemüveg (3. Gen., barna) - 暗視装置 (第3世代、ブラウン) + NVゴーグル (第3世代、ブラウン) 야투경 (3세대, 갈색) 夜视仪(三代,棕色) 夜視鏡 (三代, 棕色) @@ -125,21 +125,23 @@ NV Goggles (Gen3, Brown, WP) - 暗視装置 (第3世代、ブラウン) + NVゴーグル (第3世代、ブラウン、白色蛍光) Visore Notturno (Gen3, Marrone, FB) Gogle noktowizyjne (Gen3, Brązowe, WP) NS-Brille (3. Generation, Braun, WP) 야투경 (3세대, 갈색, 백색광) JVN (Gen3, marron, WP) + ПНВ (Gen3, Коричневый, БФ) Night Vision Goggles, White Phosphor - 暗視装置、白色蛍光 + ナイトビジョン・ゴーグル、白色蛍光 Visore Notturno, Fosforo Bianco Gogle noktowizyjne, Biały Fosfor Nachtsichtbrille, weißer Phosphor 백색광 야투경 Jumelles Vision Nocturne, Phosphore blanc + Очки ночного видения, белый фосфор NV Goggles (Gen3, Green) @@ -152,7 +154,7 @@ ПНВ (Gen3, Зелёный) Gafas de visión nocturna (Gen3, Verde) Éjjellátó szemüveg (3. Gen., zöld) - 暗視装置 (第3世代、グリーン) + NVゴーグル (第3世代、グリーン) 야투경 (3세대, 녹색) 夜视仪(三代,绿色) 夜視鏡 (三代, 綠色) @@ -161,11 +163,12 @@ NV Goggles (Gen3, Green, WP) Visore Notturno (Gen3, Verde, FB) - 暗視装置 (第3世代、グリーン、白色蛍光) + NVゴーグル (第3世代、グリーン、白色蛍光) Gogle noktowizyjne (Gen3, Zielone, WP) NS-Brille (3. Generation, Grün, WP) 야투경 (3세대, 녹색, 백색광) JVN (Gen3, vertes, WP) + ПНВ (Gen3, Зелёный, БФ) NV Goggles (Gen3, Black) @@ -178,7 +181,7 @@ ПНВ (Gen3, Чёрный) Gafas de visión nocturna (Gen3, Negro) Éjjellátó szemüveg (3. Gen., fekete) - 暗視装置 (第3世代、ブラック) + NVゴーグル (第3世代、ブラック) 야투경 (3세대, 검정색) 夜视仪(三代,黑色) 夜視鏡 (三代, 黑色) @@ -186,19 +189,20 @@ NV Goggles (Gen3, Black, WP) - 暗視装置 (第3世代、ブラック、白色蛍光) + NVゴーグル (第3世代、ブラック、白色蛍光) Visore Notturno (Gen3, Nero, FB) Gogle noktowizyjne (Gen3, Czarne, WP) NS-Brille (3. Generation, Schwarz, WP) 야투경 (3세대, 검정, 백색광) JVN (Gen3, noires, WP) + ПНВ (Gen3, Чёрный, БФ) NV Goggles (Gen4, Brown) JVN (Gen4, marron) ПНВ (Gen4, Коричневый) Visore Notturno (Gen4, Marrone) - 暗視装置 (第4世代、ブラウン) + NVゴーグル (第4世代、ブラウン) Gogle noktowizyjne (Gen 4, Brązowe) NS-Brille (4. Gen., braun) 夜视仪(四代,棕色) @@ -207,19 +211,20 @@ NV Goggles (Gen4, Brown, WP) - 暗視装置 (第4世代、ブラウン、白色蛍光) + NVゴーグル (第4世代、ブラウン、白色蛍光) Visore Notturno (Gen4, Marrone, FB) Gogle noktowizyjne (Gen 4, Brązowe, WP) NS-Brille (4. Generation, Braun, WP) 야투경 (4세대, 갈색, 백색광) JVN (Gen4, marron, WP) + ПНВ (Gen4, Коричневый, БФ) NV Goggles (Gen4, Black) JVN (Gen4, noires) ПНВ (Gen4, Чёрный) Visore Notturno (Gen4, Nero) - 暗視装置 (第3世代、ブラック) + NVゴーグル (第4世代、ブラック) Gogle noktowizyjne (Gen 4, Czarne) NS-Brille (4. Gen., schwarz) 夜视仪(四代,黑色) @@ -228,19 +233,20 @@ NV Goggles (Gen4, Black, WP) - 暗視装置 (第3世代、ブラック、白色蛍光) + NVゴーグル (第4世代、ブラック、白色蛍光) Visore Notturno (Gen4, Nero, FB) Gogle noktowizyjne (Gen 4, Czarne, WP) NS-Brille (4. Generation, Schwarz, WP) 야투경 (4세대, 검정, 백색광) JVN (Gen4, noires, WP) + ПНВ (Gen4, Чёрный, БФ) NV Goggles (Gen4, Green) JVN (Gen4, vertes) ПНВ (Gen4, Зелёный) Visore Notturno (Gen4, Verde) - 暗視装置 (第3世代、グリーン) + NVゴーグル (第4世代、グリーン) Gogle noktowizyjne (Gen 4, Zielone) NS-Brille (4. Gen., grün) 夜视仪(四代,绿色) @@ -249,19 +255,20 @@ NV Goggles (Gen4, Green, WP) - 暗視装置 (第3世代、グリーン、白色蛍光) + NVゴーグル (第4世代、グリーン、白色蛍光) Visore Notturno (Gen4, Verde, FB) Gogle noktowizyjne (Gen 4, Zielone, WP) NS-Brille (4. Generation, Grün, WP) 야투경 (4세대, 녹색, 백색광) JVN (Gen4, vertes, WP) + ПНВ (Gen4, Зелёный, БФ) NV Goggles (Wide, Brown) JVN (Large, marron) ПНВ (Широкий, Коричневый) Visore Notturno (Grandangolo, Marrone) - 暗視装置 (ワイド、ブラウン) + NVゴーグル (ワイド、ブラウン) Gogle noktowizyjne (Szerokie, Brązowe) NS-Brille (Weit, braun) 夜视仪(宽,棕色) @@ -270,19 +277,20 @@ NV Goggles (Wide, Brown, WP) - 暗視装置 (ワイド、ブラウン、白色蛍光) + NVゴーグル (ワイド、ブラウン、白色蛍光) Visore Notturno (Grandangolo, Marrone, FB) Gogle noktowizyjne (Szerokie, Brązowe, WP) NS-Brille (Weit, Braun, WP) 야투경 (넓음, 갈색, 백색광) JVN (Large, marron, WP) + ПНВ (Широкий, Коричневый, БФ) NV Goggles (Wide, Black) JVN (Large, noires) ПНВ (Широкий, Чёрный) Visore Notturno (Grandangolo, Nero) - 暗視装置 (ワイド、ブラック) + NVゴーグル (ワイド、ブラック) Gogle noktowizyjne (Szerokie, Czarne) NS-Brille (Weit, schwarz) 夜视仪(宽,黑色) @@ -291,19 +299,20 @@ NV Goggles (Wide, Black, WP) - 暗視装置 (ワイド、ブラック、白色蛍光) + NVゴーグル (ワイド、ブラック、白色蛍光) Visore Notturno (Grandangolo, Nero, FB) Gogle noktowizyjne (Szerokie, Czarne, WP) NS-Brille (Weit, Schwarz, WP) 야투경 (넓음, 검정, 백색광) JVN (Large, noires, WP) + ПНВ (Широкий, Чёрный, БФ) NV Goggles (Wide, Green) JVN (Large, vertes) ПНВ (Широкий, Зелёный) Visore Notturno (Grandangolo, Verde) - 暗視装置 (ワイド、グリーン) + NVゴーグル (ワイド、グリーン) Gogle noktowizyjne (Szerokie, Zielone) NS-Brille (Weit, grün) 夜视仪(宽,绿色) @@ -312,12 +321,13 @@ NV Goggles (Wide, Green, WP) - 暗視装置 (ワイド、グリーン、白色蛍光) + NVゴーグル (ワイド、グリーン、白色蛍光) Visore Notturno (Grandangolo, Verde, FB) Gogle noktowizyjne (Szerokie, Zielone, WP) NS-Brille (Weit, Grün, WP) 야투경 (넓음, 녹색, 백색광) JVN (Large, vertes, WP) + ПНВ (Широкий, Зелёный, БФ) Brightness: %1 @@ -450,7 +460,7 @@ Fog is used to limit visibility. - フォグは視程制限のために使われます。 + 霧で視程を制限します。 La nebbia viene utilizzata per limitare la visibilità. Nebel wird genutzt, um die Sichtbarkeit einzuschränken. 透過霧氣來縮減夜視鏡的可視距離 @@ -528,7 +538,7 @@ Intensität des Bildrauschens im Nachtsichtgerät 調整配戴夜視鏡時畫面雜訊的多寡。 调整配戴夜视仪时画面噪声的强度。 - 暗視装置を使用時に起きる画像ノイズの強度です + 暗視装置使用時の画像ノイズの強度 Intensité du bruit de l'image lorsque vous portez des JVN. Intensità del disturbo nell'immagine degli NVG Intensywność efektu szumu podczas noszenia gogli noktowizyjnych @@ -556,7 +566,7 @@ Rolling shutter effect from muzzle flashes Rolling-Shutter-Effekt bei Müdungsfeuer - 発射炎が作るローリング シャッター効果 + 発射炎によるローリング シャッター効果 枪械开火时产生瞬间快门效果 槍開火時瞬間產生快門效果 Effet d'obturateur à rideau dû aux flashs du canon. @@ -576,6 +586,7 @@ Nachtsicht-Generation 야투경 세대 Génération de jumelles de vision nocturne + Генерация ночного видения Gen %1 @@ -585,6 +596,7 @@ Gen %1 %1세대 Gen %1 + Генерация %1 diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf index ad7622eadd..9628974800 100644 --- a/addons/nlaw/functions/fnc_attackProfile.sqf +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -56,5 +56,5 @@ if ((count _test) > 0) then { }; #endif -// TRACE_1("Adjusted target position", _returnTargetPos); +// TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/nlaw/stringtable.xml b/addons/nlaw/stringtable.xml index 4d3c0638f2..0d2eaca93a 100644 --- a/addons/nlaw/stringtable.xml +++ b/addons/nlaw/stringtable.xml @@ -25,7 +25,7 @@ 直射模式 直射模式 Bezpośredni atak - 직선 공격 + 직사 타격 Прямая атака Ataque Direto Attaque directe @@ -41,7 +41,7 @@ 飞越攻顶模式 攻頂模式 Atak z góry - 탑어택 + 상부 타격 Атака сверху Ataque por cima Attaque par le haut diff --git a/addons/novehicleclanlogo/stringtable.xml b/addons/novehicleclanlogo/stringtable.xml index d3f01899a9..96d463f582 100644 --- a/addons/novehicleclanlogo/stringtable.xml +++ b/addons/novehicleclanlogo/stringtable.xml @@ -5,7 +5,7 @@ Remove clan logo from vehicles Usuń logo klanu z pojazdów 차량에서 클랜 로고 제거 - Убрать логотип кланов с техники + Убрать логотип отрядов с техники Suprimir logo del clan de los vehículos 乗り物から部隊ロゴを削除 Clan-Logo von Fahrzeugen entfernen @@ -16,7 +16,7 @@ Prevents clan logo from being displayed on vehicles controlled by players. Zapobiega wyświetlaniu logo klanu na pojazdach kontrolowanych przez graczy. 플레이어가 조종하는 차량에 클랜 로고가 표시되지 않도록 합니다. - Не отображать логотипы кланов на технике контроллируемой игроками. + Не отображать логотипы отрядов на технике контроллируемой игроками. Previene que se muestre el logo del clan en los vehículos controlados por jugadores. プレイヤーが操作する乗り物に部隊ロゴが表示されないようにする。 Verhindert, dass das Clan-Logo auf von Spielern kontrollierten Fahrzeugen angezeigt wird. diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index abb97e5b5d..1641ee2174 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -28,4 +28,4 @@ GVAR(camera) = objNull; }] call CBA_fnc_addPlayerEventHandler; // Register fire event handler -["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; +["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index 5a1ae0eca0..f36f04d881 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -18,7 +18,7 @@ */ // IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); disableSerialization; diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index df431407da..c7fb19c9c1 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -80,11 +80,11 @@ if (_isPIP) then { // Calculate lighting private _dayOpacity = call EFUNC(common,ambientBrightness); -private _nightOpacity = [1, 0] select (_dayOpacity == 1); +private _nightOpacity = parseNumber (_dayOpacity == 1); // Apply lighting and make layers visible (_display displayCtrl 1713001) ctrlSetTextColor [1, 1, 1, 1]; -(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, [0, 1] select (_dayOpacity < 0.5)]; +(_display displayCtrl 1713002) ctrlSetTextColor [1, 1, 1, parseNumber (_dayOpacity < 0.5)]; (_display displayCtrl 1713005) ctrlSetTextColor [1, 1, 1, _dayOpacity]; (_display displayCtrl 1713006) ctrlSetTextColor [1, 1, 1, _nightOpacity]; diff --git a/addons/optionsmenu/initSettings.inc.sqf b/addons/optionsmenu/initSettings.inc.sqf index bf77a84fcc..e5bb44e512 100644 --- a/addons/optionsmenu/initSettings.inc.sqf +++ b/addons/optionsmenu/initSettings.inc.sqf @@ -5,5 +5,9 @@ private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(aceNews)] LSTRING(showNewsOnMainMenu_name), _category, true, - 0 + 0, + { + if (!hasInterface) exitWith {}; + profileNamespace setVariable [QGVAR(showNewsOnMainMenu), _this]; + } ] call CBA_fnc_addSetting; diff --git a/addons/overheating/ACE_Arsenal_Stats.hpp b/addons/overheating/ACE_Arsenal_Stats.hpp new file mode 100644 index 0000000000..ef1e497c55 --- /dev/null +++ b/addons/overheating/ACE_Arsenal_Stats.hpp @@ -0,0 +1,21 @@ +class EGVAR(arsenal,stats) { + class statBase; + class ACE_allowSwapBarrel: statBase { + scope = 2; + priority = -1; + stats[] = {QGVAR(allowSwapBarrel)}; + displayName = CSTRING(statBarrelType); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_allowSwapBarrel)); + tabs[] = {{0,1}, {}}; + }; + class ACE_boltType: statBase { + scope = 2; + priority = -1.1; + stats[] = {QGVAR(closedBolt)}; + displayName = CSTRING(statBoltType); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_boltType)); + tabs[] = {{0,1}, {}}; + }; +}; diff --git a/addons/overheating/XEH_PREP.hpp b/addons/overheating/XEH_PREP.hpp index 865a049569..91d345914d 100644 --- a/addons/overheating/XEH_PREP.hpp +++ b/addons/overheating/XEH_PREP.hpp @@ -25,6 +25,8 @@ PREP(overheat); PREP(sendSpareBarrelsTemperaturesHint); PREP(setAmmoTemperature); PREP(setWeaponTemperature); +PREP(statTextStatement_boltType); +PREP(statTextStatement_allowSwapBarrel); PREP(swapBarrel); PREP(swapBarrelAssistant); PREP(swapBarrelCallback); diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index bbcd9da97f..a49030b1ad 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -20,7 +20,7 @@ if (hasInterface) then { }; ["CBA_settingsInitialized", { - TRACE_1("SettingsInitialized eh", GVAR(enabled)); + TRACE_1("SettingsInitialized eh",GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; if (isServer) then { @@ -35,8 +35,8 @@ if (hasInterface) then { GVAR(storedSpareBarrels) = createHashMap; // Install event handlers for spare barrels - [QGVAR(sendSpareBarrelTemperatureHint), FUNC(sendSpareBarrelsTemperaturesHint)] call CBA_fnc_addEventHandler; - [QGVAR(loadCoolestSpareBarrel), FUNC(loadCoolestSpareBarrel)] call CBA_fnc_addEventHandler; + [QGVAR(sendSpareBarrelTemperatureHint), LINKFUNC(sendSpareBarrelsTemperaturesHint)] call CBA_fnc_addEventHandler; + [QGVAR(loadCoolestSpareBarrel), LINKFUNC(loadCoolestSpareBarrel)] call CBA_fnc_addEventHandler; // Schedule cool down calculation of stored spare barrels [] call FUNC(updateSpareBarrelsTemperaturesThread); @@ -50,14 +50,14 @@ if (hasInterface) then { //Add Take EH if required if (GVAR(unJamOnReload) || {GVAR(cookoffCoef) > 0}) then { - ["CAManBase", "Take", {_this call FUNC(handleTakeEH);}] call CBA_fnc_addClassEventHandler; + ["CAManBase", "Take", LINKFUNC(handleTakeEH)] call CBA_fnc_addClassEventHandler; }; // Register fire event handler - ["ace_firedPlayer", DFUNC(firedEH)] call CBA_fnc_addEventHandler; + ["ace_firedPlayer", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler; // Only add eh to non local players if dispersion is enabled if (GVAR(overheatingDispersion) || {GVAR(showParticleEffectsForEveryone)}) then { - ["ace_firedPlayerNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler; }; // Schedule cool down calculation of player weapons at (infrequent) regular intervals @@ -86,10 +86,10 @@ if (hasInterface) then { }] call CBA_fnc_addClassEventHandler; // Install event handler to display temp when a barrel was swapped - [QGVAR(showWeaponTemperature), DFUNC(displayTemperature)] call CBA_fnc_addEventHandler; + [QGVAR(showWeaponTemperature), LINKFUNC(displayTemperature)] call CBA_fnc_addEventHandler; // Install event handler to initiate an assisted barrel swap - [QGVAR(initiateSwapBarrelAssisted), DFUNC(swapBarrel)] call CBA_fnc_addEventHandler; + [QGVAR(initiateSwapBarrelAssisted), LINKFUNC(swapBarrel)] call CBA_fnc_addEventHandler; // Add an action to allow hot weapons to be cooled off in AceX Field Rations water sources if (["acex_field_rations"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index f04238fd10..4d8fb34cc3 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -26,6 +26,8 @@ class CfgPatches { #include "ACE_Settings.hpp" +#include "ACE_Arsenal_Stats.hpp" + class CfgMovesBasic { class ManActions { GVAR(GestureMountMuzzle) = QGVAR(GestureMountMuzzle); diff --git a/addons/overheating/functions/fnc_calculateCooling.sqf b/addons/overheating/functions/fnc_calculateCooling.sqf index f01f3950e7..e7ac83f236 100644 --- a/addons/overheating/functions/fnc_calculateCooling.sqf +++ b/addons/overheating/functions/fnc_calculateCooling.sqf @@ -7,6 +7,7 @@ * 0: Initial temperature * 1: Barrel mass * 2: Time interval + * 3: Bolt type * * Return Value: * Final temperature @@ -17,7 +18,7 @@ * Public: No */ -params ["_temperature", "_barrelMass", "_totalTime"]; +params ["_temperature", "_barrelMass", "_totalTime", "_boltType"]; // The lowest temperature a weapon can reach is the ambient air temperature. private _ambientTemperature = ambientTemperature select 0; @@ -43,6 +44,9 @@ if (ACE_player call EFUNC(common,isSwimming)) then { _convectionRate = _convectionRate * ((linearConversion [0,1,rain,1,5,true] + (5 min (vectorMagnitude wind / 10))) / 2); }; +//Increase convection cooling for open bolt type guns +if (_boltType == 0) then {_convectionRate = _convectionRate * OPEN_BOLT_ADDITIONAL_CONVECTION}; + TRACE_4("cooling",_temperature,_totalTime,_barrelMass,_barrelSurface); private _time = 0; diff --git a/addons/overheating/functions/fnc_coolWeaponWithItem.sqf b/addons/overheating/functions/fnc_coolWeaponWithItem.sqf index bc21963fb6..e5e79aaf62 100644 --- a/addons/overheating/functions/fnc_coolWeaponWithItem.sqf +++ b/addons/overheating/functions/fnc_coolWeaponWithItem.sqf @@ -61,8 +61,8 @@ private _fnc_onSuccess = { }; // cool the weapon - private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; - _temperature = [_temperature, _barrelMass, _liquidAmount * 10] call FUNC(calculateCooling); + private _weaponData = [_weapon] call FUNC(getWeaponData); + _temperature = [_temperature, _weaponData select 7, _liquidAmount * 10, _weaponData select 6] call FUNC(calculateCooling); [_target, _tempVarName, _temperature, TEMP_TOLERANCE] call EFUNC(common,setApproximateVariablePublic); }; diff --git a/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf b/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf index acf3286c4a..67f22a3cc0 100644 --- a/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf +++ b/addons/overheating/functions/fnc_coolWeaponWithWaterSource.sqf @@ -59,8 +59,8 @@ private _fnc_condition = { }; //Cool the weapon down - private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; - _temperature = [_temperature, _barrelMass, 20] call FUNC(calculateCooling); + private _weaponData = [_weapon] call FUNC(getWeaponData); + _temperature = [_temperature, _weaponData select 7, 20, _weaponData select 6] call FUNC(calculateCooling); [_player, _tempVarName, _temperature, TEMP_TOLERANCE] call EFUNC(common,setApproximateVariablePublic); /* // to be added when licence compatible audio can be found or recorded diff --git a/addons/overheating/functions/fnc_firedEH.sqf b/addons/overheating/functions/fnc_firedEH.sqf index 9db3a73dd6..bdb7f864c9 100644 --- a/addons/overheating/functions/fnc_firedEH.sqf +++ b/addons/overheating/functions/fnc_firedEH.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); BEGIN_COUNTER(firedEH); diff --git a/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf b/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf index 29b7191471..a5fb95cf31 100644 --- a/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf +++ b/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf @@ -31,7 +31,7 @@ if (_weaponBarrelClass == "") then { // Find all spare barrel the player has private _allBarrels = [_assistant, _weaponBarrelClass] call CBA_fnc_getMagazineIndex; TRACE_1("_allBarrels",_allBarrels); -if ((count _allBarrels) < 1) exitWith {}; +if (_allBarrels isEqualTo []) exitWith {}; // Determine which on is coolest private _coolestTemp = 10000; diff --git a/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf b/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf index 9204b58124..5f75423f2e 100644 --- a/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf +++ b/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf @@ -32,7 +32,7 @@ if (_weaponBarrelClass == "") then { }; private _allBarrels = [_unit, _weaponBarrelClass] call CBA_fnc_getMagazineIndex; TRACE_1("_allBarrels",_allBarrels); -if ((count _allBarrels) < 1) exitWith {}; +if (_allBarrels isEqualTo []) exitWith {}; // Determine the temp of each barrel private _temps = []; diff --git a/addons/overheating/functions/fnc_statTextStatement_allowSwapBarrel.sqf b/addons/overheating/functions/fnc_statTextStatement_allowSwapBarrel.sqf new file mode 100644 index 0000000000..9713023c17 --- /dev/null +++ b/addons/overheating/functions/fnc_statTextStatement_allowSwapBarrel.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: drofseh + * Barrel Type statement. + * + * Arguments: + * 0: Not used + * 1: Item config path + * + * Return Value: + * Stat Text + * + * Public: No +*/ + +params ["", "_config"]; +TRACE_1("statTextStatement_allowSwapBarrel",_config); + +if ((getNumber (_config >> QGVAR(allowSwapBarrel))) == 1) exitWith {LLSTRING(statBarrelType_removeable)}; + +LLSTRING(statBarrelType_nonRemoveable) diff --git a/addons/overheating/functions/fnc_statTextStatement_boltType.sqf b/addons/overheating/functions/fnc_statTextStatement_boltType.sqf new file mode 100644 index 0000000000..67967496c7 --- /dev/null +++ b/addons/overheating/functions/fnc_statTextStatement_boltType.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: drofseh + * Bolt Type statement. + * + * Arguments: + * 0: Not used + * 1: Item config path + * + * Return Value: + * Stat Text + * + * Public: No +*/ + +params ["", "_config"]; +TRACE_1("statTextStatement_boltType",_config); + +if ((getNumber (_config >> QGVAR(closedBolt))) == 1) exitWith {LLSTRING(statBoltType_closedBolt)}; + +LLSTRING(statBoltType_openBolt) diff --git a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf index 64110b2c76..da87c5fdba 100644 --- a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf +++ b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf @@ -20,10 +20,10 @@ TRACE_1("updateSpareBarrelsTemperaturesThread1",GVAR(storedSpareBarrels)); _y params ["_initialTemp","_initialTime", "_barrelMass"]; // Calculate cooling - private _finalTemp = [_initialTemp, _barrelMass, CBA_missionTime - _initialTime] call FUNC(calculateCooling); + private _finalTemp = [_initialTemp, _barrelMass, CBA_missionTime - _initialTime, 0] call FUNC(calculateCooling); //the zero is to indicate an open bolt gun. Barrel is outside of a gun here, so always open. TRACE_4("updateSpareBarrelsTemperaturesThread2",_barrelMagazineID,_initialTemp,_finalTemp,_barrelMass); - if (_finalTemp < 5) then { - // The barrel is cool enough to keep calculating. Remove it from the hash + if (_finalTemp <= (ambientTemperature select 0)) then { + // The barrel is cool enough to finish calculating. Remove it from the hash GVAR(storedSpareBarrels) deleteAt _x; } else { // Store the new temp diff --git a/addons/overheating/functions/fnc_updateTemperature.sqf b/addons/overheating/functions/fnc_updateTemperature.sqf index 8d5ca5d412..db7f48be83 100644 --- a/addons/overheating/functions/fnc_updateTemperature.sqf +++ b/addons/overheating/functions/fnc_updateTemperature.sqf @@ -33,8 +33,9 @@ _trackedWeapons pushBackUnique _tempVarName; _unit setVariable [QGVAR(trackedWeapons), _trackedWeapons]; // Calculate cooling -private _barrelMass = ([_weapon] call FUNC(getWeaponData)) select 7; -_temperature = [_temperature, _barrelMass, CBA_missionTime - _lastTime] call FUNC(calculateCooling); +private _weaponData = [_weapon] call FUNC(getWeaponData); +private _barrelMass = _weaponData select 7; +_temperature = [_temperature, _barrelMass, CBA_missionTime - _lastTime, _weaponData select 6] call FUNC(calculateCooling); TRACE_1("cooledTo",_temperature); // Calculate heating diff --git a/addons/overheating/script_component.hpp b/addons/overheating/script_component.hpp index 0837733cd3..dd1b18806f 100644 --- a/addons/overheating/script_component.hpp +++ b/addons/overheating/script_component.hpp @@ -19,6 +19,7 @@ #define TEMP_TOLERANCE 50 #define METAL_MASS_RATIO 0.55 #define GUNPOWDER_IGNITION_TEMP 180 +#define OPEN_BOLT_ADDITIONAL_CONVECTION 1.1 #ifdef DEBUG_MODE_FULL #define TRACE_PROJECTILE_INFO(BULLET) _vdir = vectorNormalized velocity BULLET; _dir = (_vdir select 0) atan2 (_vdir select 1); _up = asin (_vdir select 2); _mv = vectorMagnitude velocity BULLET; TRACE_3("adjusted projectile",_dir,_up,_mv); diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index 2c6249be2f..48399b443c 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -875,5 +875,53 @@ 备用枪管温度非常热 備用槍管溫度超級熱 + + Bolt Type + Tipo di otturatore + 遊底(ボルト)形式 + 노리쇠 방식 + Тип болта + Type d'obturateur + + + Open Bolt + Otturatore Aperto + オープンボルト + 오픈 볼트 + Открыть болт + Obturateur ouvert + + + Closed Bolt + Otturatore Chiuso + クローズドボルト + 클로즈드 볼트 + Закрыть болт + Obturateur fermé + + + Barrel Type + Tipo di Canna + 銃身形式 + 총열 방식 + Тип ствола + Type de canon + + + Non-Removeable + Non-Rimovibile + 取り外し不可 + 제거 불가 + Несъемный + Inamovible + + + Quick Change + Cambio Rapido + 即時交換可 + 신속 교체 + Быстросъемный + Changement rapide + diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index a36eb8bd56..2ef48bf4d9 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); // Retrieve backblast values private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 7a76f4b2be..2345d09327 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); // Retrieve overpressure values private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); diff --git a/addons/overpressure/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf index 891178cb52..64ee563974 100644 --- a/addons/overpressure/functions/fnc_getDistance.sqf +++ b/addons/overpressure/functions/fnc_getDistance.sqf @@ -19,7 +19,7 @@ */ params ["_posASL", "_direction", "_maxDistance", "_shooter"]; -TRACE_4("params",_posASL,_direction,_maxDistance, _shooter); +TRACE_4("params",_posASL,_direction,_maxDistance,_shooter); private _intersections = lineIntersectsSurfaces [_posASL, _posASL vectorAdd (_direction vectorMultiply _maxDistance), _shooter, objNull, true, 99]; diff --git a/addons/parachute/RscTitles.hpp b/addons/parachute/RscTitles.hpp index 9e0a169937..48cf11bee4 100644 --- a/addons/parachute/RscTitles.hpp +++ b/addons/parachute/RscTitles.hpp @@ -39,10 +39,10 @@ class RscTitles { }; class TimeText: RscText { idc = 1001; - text = "00:00"; - x = "0.206094 * safezoneW + safezoneX"; + text = "00:00:00"; + x = "0.202094 * safezoneW + safezoneX"; y = "0.819 * safezoneH + safezoneY"; - w = "0.0309375 * safezoneW"; + w = "0.0380375 * safezoneW"; h = "0.022 * safezoneH"; colorText[] = {0,0,0,1}; }; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 1217fa3cab..f10748b0cf 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -34,9 +34,9 @@ if (!hasInterface) exitWith {}; }, {false}, [24, [false, false, false]], false] call CBA_fnc_addKeybind; // Handle reserve chute based on current backpack (fires when parachute opens too) -["loadout", FUNC(handleReserve), true] call CBA_fnc_addPlayerEventHandler; +["loadout", LINKFUNC(handleReserve), true] call CBA_fnc_addPlayerEventHandler; // Don't show vanilla speed and height when in expert mode -["ace_infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call CBA_fnc_addEventHandler; +["ace_infoDisplayChanged", LINKFUNC(handleInfoDisplayChanged)] call CBA_fnc_addEventHandler; -["vehicle", {_this call FUNC(handleFailureChance)}] call CBA_fnc_addPlayerEventHandler; +["vehicle", LINKFUNC(handleFailureChance)] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index 564a9e09cd..c66d9ff050 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -16,7 +16,7 @@ * Public: No */ params ["_unit", "_parachute"]; -TRACE_2("cutParachute", _unit, _parachute); +TRACE_2("cutParachute",_unit,_parachute); playSound3d ["A3\Sounds_F\characters\parachute\parachute_landing.wss", _unit]; _unit action ["GetOut", _parachute]; diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 47b014f4ab..f86f785cc6 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -40,8 +40,10 @@ private _TimeText = _display displayCtrl 1001; _pfhID call CBA_fnc_removePerFrameHandler; }; - private _hour = floor daytime; - private _minute = floor ((daytime - _hour) * 60); + private _daytime = dayTime; + private _hour = floor _daytime; + private _minute = floor ((_daytime - _hour) * 60); + private _seconds = floor ((((_daytime - _hour) * 60) - _minute) * 60); private _curTime = CBA_missionTime; private _timeDiff = _curTime - _prevTime; @@ -52,9 +54,9 @@ private _TimeText = _display displayCtrl 1001; 0 }; - _TimeText ctrlSetText (format ["%1:%2", [_hour, 2] call CBA_fnc_formatNumber, [_minute, 2] call CBA_fnc_formatNumber]); - _HeightText ctrlSetText (format ["%1", floor _height]); - _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); + _TimeText ctrlSetText (format ["%1:%2:%3", [_hour, 2] call CBA_fnc_formatNumber, [_minute, 2] call CBA_fnc_formatNumber, [_seconds, 2] call CBA_fnc_formatNumber]); + _HeightText ctrlSetText str floor _height; + _DecendRate ctrlSetText str (_descentRate max 0); (_this select 0) set [1, _height]; (_this select 0) set [2, _curTime]; diff --git a/addons/pylons/stringtable.xml b/addons/pylons/stringtable.xml index d431910d34..1021a2fc15 100644 --- a/addons/pylons/stringtable.xml +++ b/addons/pylons/stringtable.xml @@ -289,7 +289,7 @@ The time it takes to replace each pylon (in seconds). - 各パイロンの置き換えに掛かる時間を設定します。(秒) + 各パイロンの置き換えに掛かる時間。 (秒単位) Il tempo che impiega ogni pilone ad essere sostituito (in secondi). 每個派龍架需花多久時間進行整補(單位為秒) 每个挂架需花多久时间进行整装(单位为秒)。 diff --git a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf index e55d498809..c1318e3f74 100644 --- a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf +++ b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf @@ -29,6 +29,7 @@ #define TO_COMPARTMENT_STRING(var) if !(var isEqualType "") then {var = format [ARR_2("Compartment%1",var)]} // if unit isn't moved to new seat in TAKEN_SEAT_TIMEOUT, we move him back to his seat +#pragma hemtt suppress pw3_padded_arg file #define WAIT_IN_OR_MOVE_BACK \ [ARR_5( \ {!isNull objectParent (_this select 0)}, \ @@ -158,7 +159,7 @@ private _cargoNumber = -1; }; } else { private ["_name", "_icon", "_statement", "_params"]; - switch (toLower _role) do { + switch (toLowerANSI _role) do { case "driver": { if ( lockedDriver _vehicle diff --git a/addons/quickmount/functions/fnc_getInNearest.sqf b/addons/quickmount/functions/fnc_getInNearest.sqf index c618681f7e..5e6c21eb36 100644 --- a/addons/quickmount/functions/fnc_getInNearest.sqf +++ b/addons/quickmount/functions/fnc_getInNearest.sqf @@ -69,7 +69,7 @@ if (!isNull _target && { _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; if ((isNull _unit) || {!alive _unit}) then { - private _effectiveRole = toLower _role; + private _effectiveRole = toLowerANSI _role; if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner if ((_effectiveRole == "driver") && {(getNumber (configOf _target >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) diff --git a/addons/rangecard/XEH_postInit.sqf b/addons/rangecard/XEH_postInit.sqf index 6adc4cf2a1..af4dfa923c 100644 --- a/addons/rangecard/XEH_postInit.sqf +++ b/addons/rangecard/XEH_postInit.sqf @@ -1,7 +1,5 @@ #include "script_component.hpp" -#include "initKeybinds.inc.sqf" - GVAR(RangeCardOpened) = false; GVAR(controls) = []; @@ -17,3 +15,7 @@ GVAR(boreHeightCopy) = 3.81; GVAR(ammoClassCopy) = "";//"ACE_762x51_Ball_M118LR"; GVAR(magazineClassCopy) = "";//"ACE_20Rnd_762x51_M118LR_Mag"; GVAR(weaponClassCopy) = "";//srifle_DMR_06_olive_F"; + +if (!hasInterface) exitWith {}; + +#include "initKeybinds.inc.sqf" diff --git a/addons/rangecard/functions/fnc_calculateRangeCard.sqf b/addons/rangecard/functions/fnc_calculateRangeCard.sqf index 179437eb58..d2347b8494 100644 --- a/addons/rangecard/functions/fnc_calculateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_calculateRangeCard.sqf @@ -49,7 +49,8 @@ private _bulletSpeed = 0; private _gravity = [0, sin(_scopeBaseAngle) * -GRAVITY, cos(_scopeBaseAngle) * -GRAVITY]; private _deltaT = 1 / _simSteps; private _speedOfSound = 0; -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { +private _isABenabled = missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]; +if (_isABenabled) then { _speedOfSound = _temperature call EFUNC(weather,calculateSpeedOfSound); }; @@ -68,7 +69,7 @@ if (_useABConfig) then { }; private _airFrictionCoef = 1; -if (!_useABConfig && (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { +if (!_useABConfig && _isABenabled) then { private _airDensity = [_temperature, _barometricPressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); _airFrictionCoef = _airDensity / 1.22498; }; diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index d7acd46486..c2c8673844 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -33,7 +33,7 @@ if (_ammoClass == "" || _magazineClass == "" || _weaponClass == "") exitWith {}; GVAR(controls) = []; for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _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 { @@ -47,7 +47,7 @@ for "_row" from 0 to 49 do { }; for "_column" from 0 to 8 do { for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _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; @@ -57,7 +57,7 @@ for "_column" from 0 to 8 do { }; for "_column" from 0 to 2 do { for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _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; @@ -67,7 +67,7 @@ for "_column" from 0 to 2 do { }; for "_column" from 0 to 2 do { for "_row" from 0 to 49 do { - private _offset = if (_row < 5) then {0} else {0.003}; + private _offset = [0.003, 0] select (_row < 5); private _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; @@ -100,19 +100,24 @@ private _barrelLength = _weaponConfig select 2; private _muzzleVelocity = 0; private _bc = 0; -if (count (_ammoConfig select 6) > 0) then { +if ((_ammoConfig select 6) isNotEqualTo []) then { _bc = (_ammoConfig select 6) select 0; }; private _transonicStabilityCoef = _ammoConfig select 4; private _dragModel = _ammoConfig select 5; private _atmosphereModel = _ammoConfig select 8; -private _useABConfig = (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]); -if (_bc == 0) then { - _useABConfig = false; -}; +private _isABenabled = (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (_bc != 0); +private _useBarrelLengthInfluence = ( + _isABenabled && + {missionNamespace getVariable [QEGVAR(advanced_ballistics,barrelLengthInfluenceEnabled), false]} +); +private _useAmmoTemperatureInfluence = ( + _isABenabled && + {missionNamespace getVariable [QEGVAR(advanced_ballistics,ammoTemperatureEnabled), false]} +); -if (_barrelLength > 0 && _useABConfig) then { +if (_barrelLength > 0 && _useBarrelLengthInfluence) then { _muzzleVelocity = [_barrelLength, _ammoConfig select 10, _ammoConfig select 11, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift); } else { private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "initSpeed"); @@ -128,7 +133,7 @@ if (_barrelLength > 0 && _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) then { - if (_useABConfig && _barrelTwist > 0) then { + if (_useBarrelLengthInfluence && _barrelTwist > 0) then { ctrlSetText [770002, format["Barrel: %1'' 1:%2'' twist", round(2 * _barrelLength * 0.0393700787) / 2, round(_barrelTwist * 0.0393700787)]]; } else { ctrlSetText [770002, format["Barrel: %1''", round(2 * _barrelLength * 0.0393700787) / 2]]; @@ -136,7 +141,7 @@ if (_barrelLength > 0) then { }; lnbAddRow [770100, ["4mps Wind(MRADs)", "1mps LEAD(MRADs)"]]; -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { +if (_isABenabled) 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"]]; @@ -145,7 +150,7 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t ctrlSetText [77003, format["%1m ZERO", round(_zeroRange)]]; -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { +if (_isABenabled) then { ctrlSetText [770001, format["Drop Tables for B.P.: %1mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C", round(EGVAR(scopes,zeroReferenceBarometricPressure) * 100) / 100]]; ctrlSetText [77004 , format["B.P.: %1mb", round(EGVAR(scopes,zeroReferenceBarometricPressure) * 100) / 100]]; } else { @@ -153,30 +158,30 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t ctrlSetText [77004 , ""]; }; -private _cacheEntry = missionNamespace getVariable format[QGVAR(%1_%2_%3_%4_%5), _zeroRange, _boreHeight, _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]]; -if (isNil {_cacheEntry}) then { - private _scopeBaseAngle = if (!_useABConfig) then { +private _cacheEntry = missionNamespace getVariable format [QGVAR(%1_%2_%3_%4_%5_%6_%7), _zeroRange, _boreHeight, _ammoClass, _weaponClass, _isABenabled, _useBarrelLengthInfluence, _useAmmoTemperatureInfluence]; +if (isNil "_cacheEntry") then { + private _scopeBaseAngle = if (!_isABenabled) then { private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; (parseNumber _zeroAngle) } else { private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZeroAB:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, EGVAR(scopes,zeroReferenceTemperature), EGVAR(scopes,zeroReferenceBarometricPressure), EGVAR(scopes,zeroReferenceHumidity), _bc, _dragModel, _atmosphereModel]; (parseNumber _zeroAngle) }; - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && missionNamespace getVariable [QEGVAR(advanced_ballistics,ammoTemperatureEnabled), false]) then { + if (_useAmmoTemperatureInfluence) then { { private _mvShift = [_ammoConfig select 9, _x] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift); private _mv = _muzzleVelocity + _mvShift; - [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),200,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,_forEachIndex,_useABConfig] call FUNC(calculateRangeCard); + [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),200,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,_forEachIndex,_isABenabled] call FUNC(calculateRangeCard); } forEach [-15, -5, 5, 10, 15, 20, 25, 30, 35]; } else { - [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),200,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,3,_useABConfig] call FUNC(calculateRangeCard); + [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),200,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,3,_isABenabled] call FUNC(calculateRangeCard); }; 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 { + if (_isABenabled) then { (GVAR(rangeCardDataElevation) select _i) pushBack "###"; (GVAR(rangeCardDataWindage) select _i) pushBack "##"; (GVAR(rangeCardDataLead) select _i) pushBack "##"; @@ -188,7 +193,7 @@ if (isNil {_cacheEntry}) then { }; }; - missionNamespace setVariable [format[QGVAR(%1_%2_%3_%4_%5), _zeroRange, _boreHeight, _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]], [GVAR(rangeCardDataElevation), GVAR(rangeCardDataWindage), GVAR(rangeCardDataLead), GVAR(rangeCardDataMVs), GVAR(lastValidRow)]]; + missionNamespace setVariable [format [QGVAR(%1_%2_%3_%4_%5_%6_%7), _zeroRange, _boreHeight, _ammoClass, _weaponClass, _isABenabled, _useBarrelLengthInfluence, _useAmmoTemperatureInfluence], [GVAR(rangeCardDataElevation), GVAR(rangeCardDataWindage), GVAR(rangeCardDataLead), GVAR(rangeCardDataMVs), GVAR(lastValidRow)]]; } else { GVAR(rangeCardDataElevation) = _cacheEntry select 0; GVAR(rangeCardDataWindage) = _cacheEntry select 1; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 045def6cd7..c67d3f70ad 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -2151,7 +2151,7 @@ F2000 (камуфляжный) F2000 (Camo) F2000 (Mimetica) - F2000 (迷彩) + F2000 (AAF迷彩) F2000 (위장) F2000突擊步槍 (迷彩) F2000(迷彩) @@ -2185,7 +2185,7 @@ F2000 Tactical (камуфляжный) F2000 Tactical (Camo) F2000 Tactical (Mimetica) - F2000 タクティカル (迷彩) + F2000 タクティカル (AAF迷彩) F2000 택티컬 (위장) F2000戰術型突擊步槍 (迷彩) F2000 战术型(迷彩) @@ -2219,7 +2219,7 @@ F2000 EGLM (камуфляжный) F2000 EGLM (Camo) F2000 EGLM (Mimetica) - F2000 EGLM (迷彩) + F2000 EGLM (AAF迷彩) F2000 EGLM (위장) F2000突擊步槍 (榴彈—迷彩) F2000 ELGM(迷彩) @@ -2440,7 +2440,7 @@ GM6 Lynx (камуфляжный) GM6 Lynx (Camo) GM6 Lynx (Mimetica) - GM6 リンクス (迷彩) + GM6 リンクス (六角形迷彩) GM6 링스 (위장) GM6 "天貓"反器材狙擊步槍 (迷彩) GM6 "猞猁"(迷彩) @@ -2542,7 +2542,7 @@ Noreen "Bad News" ULR (Mimetica) Noreen "Bad News"ULR (Terepmintás) Noreen "Bad News" ULR (Camuflagem) - ノレーン "バッド ニュース" ULR (迷彩) + ノレーン "バッド ニュース" ULR (CTRG迷彩) 노린 "배드뉴스" ULR (위장) 諾琳"壞消息"極距狙擊步槍 (迷彩) 诺琳 "坏消息" 极距狙击步枪(迷彩) @@ -2644,7 +2644,7 @@ SIG 556 (Mimetica) SIG 556 (Terepmintás) SIG 556 (Camuflagem) - SIG 556 (迷彩) + SIG 556 (MTP迷彩) 시그 556 (위장) SIG 556精準步槍 (迷彩) SIG 556(迷彩) @@ -2763,7 +2763,7 @@ Cyrus (Hex) Cyrus (Hex) Cyrus (Hex) - サイラス (ヘックス) + サイラス (六角形迷彩) 사이러스 (육각) "居鲁士"狙擊步槍 (數位蜂巢迷彩) "居鲁士"(蜂巢迷彩) @@ -2831,7 +2831,7 @@ M14 (Oliva) M14 (Olíva) M14 (Oliva) - M14 (オリーブド ラブ) + M14 (オリーブ) M14 (올리브) M14精準步槍 (橄欖色) M14(橄榄色) @@ -2865,7 +2865,7 @@ HK121 (Hex) HK121 (Hex) HK121 (Hex) - HK 121 (ヘックス) + HK 121 (六角形迷彩) HK121 (육각) HK121中型機槍 (數位蜂巢迷彩) HK121(蜂巢迷彩) @@ -2916,7 +2916,7 @@ LWMMG (MTP) LWMMG (MTP) LWMMG (MTP) - LWMMG (MTP) + LWMMG (MTP迷彩) LWMMG (MTP) 輕量化中型機槍 (多地形迷彩) LWMMG(多地形迷彩) @@ -3084,7 +3084,7 @@ QBZ-95-1 (Verde Hex) QBZ-95-1 (Zöld Hex) QBZ-95-1 (Hex Verde) - QBZ-95-1 (緑ヘックス) + QBZ-95-1 (緑六角形迷彩) QBZ-95-1 (초록육각) QBZ-95-1式自動步槍 (綠色數位蜂巢迷彩) 95-1式自动步枪(绿色蜂巢迷彩) @@ -3101,7 +3101,7 @@ QBZ-95-1 (Hex) QBZ-95-1 (Hex) QBZ-95-1 (Hex) - QBZ-95-1 (ヘックス) + QBZ-95-1 (六角形迷彩) QBZ-95-1 (육각) QBZ-95-1式自動步槍 (數位蜂巢迷彩) 95-1式自动步枪(蜂巢迷彩) @@ -3135,7 +3135,7 @@ QBZ-95-1 GL (Verde Hex) QBZ-95-1 GL (Zöld Hex) QBZ-95-1 GL (Hex Verde) - QBZ-95-1 GL (緑ヘックス) + QBZ-95-1 GL (緑六角形迷彩) QBZ-95-1 GL (초록육각) QBZ-95-1式自動步槍 (榴彈—綠色數位蜂巢迷彩) 95-1式自动步枪 10A式榴弹(绿色蜂巢迷彩) @@ -3152,7 +3152,7 @@ QBZ-95-1 GL (Hex) QBZ-95-1 GL (Hex) QBZ-95-1 GL (Hex) - QBZ-95-1 GL (ヘックス) + QBZ-95-1 GL (六角形迷彩) QBZ-95-1 GL (육각) QBZ-95-1式自動步槍 (榴彈—數位蜂巢迷彩) 95-1式自动步枪 10A式榴弹(蜂巢迷彩) @@ -3186,7 +3186,7 @@ QBZ-95-1 LSW (Verde Hex) QBZ-95-1 LSW (Zöld Hex) QBZ-95-1 LSW (Hex Verde) - QBZ-95-1 LSW (緑ヘックス) + QBZ-95-1 LSW (緑六角形迷彩) QBZ-95-1 LSW (초록육각) QBZ-95-1式輕機槍 (綠色數位蜂巢迷彩) 95-1式班用机枪(绿色蜂巢迷彩) @@ -3203,7 +3203,7 @@ QBZ-95-1 LSW (Hex) QBZ-95-1 LSW (Hex) QBZ-95-1 LSW (Hex) - QBZ-95-1 LSW (ヘックス) + QBZ-95-1 LSW (六角形迷彩) QBZ-95-1 LSW (육각) QBZ-95-1式輕機槍 (數位蜂巢迷彩) 95-1式班用机枪(蜂巢迷彩) @@ -3237,7 +3237,7 @@ QBU-88 (Verde Hex) QBU-88 (Zöld Hex) QBU-88 (Hex Verde) - QBU-88 (緑ヘックス) + QBU-88 (緑六角形迷彩) QBU-88 (초록육각) QBU-88式狙擊步槍 (綠色數位蜂巢迷彩) 88式狙击步枪(绿色蜂巢迷彩) @@ -3254,7 +3254,7 @@ QBU-88 (Hex) QBU-88 (Hex) QBU-88 (Hex) - QBU-88 (ヘックス) + QBU-88 (六角形迷彩) QBU-88 (육각) QBU-88式狙擊步槍 (數位蜂巢迷彩) 88式狙击步枪(蜂巢迷彩) @@ -3271,7 +3271,7 @@ GM6 Lynx (Verde Hex) GM6 Lynx (Zöld Hex) GM6 Lynx (Hex Verde) - GM6 リンクス (緑ヘックス) + GM6 リンクス (緑六角形迷彩) GM6 링스 (초록육각) GM6 "天貓"反器材狙擊步槍 (綠色數位蜂巢迷彩) GM6 "猞猁"(绿色蜂巢迷彩) @@ -3305,7 +3305,7 @@ M200 Intervention (тропик) M200 Intervention (Trópico) M200 Intervention (Tropico) - M200 インターベンション (熱帯迷彩) + M200 インターベンション (熱帯ジャングル迷彩) M200 인터벤션 (열대) M200干預型狙擊步槍 (熱帶迷彩) M200 "干预"(热带迷彩) @@ -3543,7 +3543,7 @@ RPG-32 (Verde Hex) RPG-32 (Zöld Hex) RPG-32 (Hex Verde) - RPG-32 (緑ヘックス) + RPG-32 (緑六角形迷彩) RPG-32 (초록육각) RPG-32火箭發射器 (綠色數位蜂巢迷彩) RPG-32(绿色蜂巢迷彩) @@ -3940,7 +3940,7 @@ ELCAN SpecterOS (Green Hex) ELCAN SpecterOS (綠色數位蜂巢迷彩) ELCAN SpecterOS(绿色蜂巢迷彩) - ELCAN SpecterOS (緑ヘックス) + ELCAN SpecterOS (緑六角形迷彩) ELCAN SpecterOS (Hex Verde) ELCAN SpecterOS (Zielony Hex) ELCAN SpecterOS (зелёный гекс) @@ -3989,7 +3989,7 @@ ELCAN SpecterOS (Leśny) ELCAN SpecterOS (Forêt) ELCAN SpecterOS (Verdeggiante) - ELCAN SpecterOS (緑地) + ELCAN SpecterOS (緑地迷彩) ELCAN SpecterOS (Grün) ELCAN SpecterOS(繁茂) 엘칸 스펙터OS (초목) @@ -4001,7 +4001,7 @@ ELCAN SpecterOS (Jałowy) ELCAN SpecterOS (Désert) ELCAN SpecterOS (Arido) - ELCAN SpecterOS (乾燥地帯) + ELCAN SpecterOS (乾燥地帯迷彩) ELCAN SpecterOS (Trocken) ELCAN SpecterOS(干旱) 엘칸 스펙터OS (건조) @@ -4025,7 +4025,7 @@ ELCAN SpecterOS 7.62 (Leśny) ELCAN SpecterOS 7.62 (Forêt) ELCAN SpecterOS 7.62 (Verdeggiante) - ELCAN SpecterOS 7.62 (緑地) + ELCAN SpecterOS 7.62 (緑地迷彩) ELCAN SpecterOS 7.62 (Grün) ELCAN SpecterOS 7.62(繁茂) 엘칸 스펙터OS 7.62 (초목) @@ -4037,7 +4037,7 @@ ELCAN SpecterOS 7.62 (Jałowy) ELCAN SpecterOS 7.62 (Désert) ELCAN SpecterOS 7.62 (Arido) - ELCAN SpecterOS 7.62 (乾燥地帯) + ELCAN SpecterOS 7.62 (乾燥地帯迷彩) ELCAN SpecterOS 7.62 (Trocken) ELCAN SpecterOS 7.62(干旱) 엘칸 스펙터OS 7.62 (건조) @@ -4112,7 +4112,7 @@ Nightforce NXS (Green Hex) Nightforce NXS (綠色數位蜂巢迷彩) Nightforce NXS(绿色蜂巢迷彩) - Nightforce NXS (緑ヘックス) + Nightforce NXS (緑六角形迷彩) Nightforce NXS (Hex Verde) Nightforce NXS (Zielony Hex) Nightforce NXS (зелёный гекс) @@ -4129,7 +4129,7 @@ Nightforce NXS (Dschungel) Nightforce NXS (叢林色) Nightforce NXS(丛林色) - Nightforce NXS (ジャングル) + Nightforce NXS (熱帯ジャングル迷彩) Nightforce NXS (Giungla) Nightforce NXS (Dżungla) Nightforce NXS (джунгли) @@ -4240,7 +4240,7 @@ KAHLES Helia (Hex) KAHLES Helia (Hex) KAHLES Helia(蜂巢迷彩) - KAHLES ヘリア (ヘックス) + KAHLES ヘリア (六角形迷彩) KAHLES Helia (Hex) KAHLES Helia (Hex) KAHLES Helia (гекс) @@ -4304,7 +4304,7 @@ Burris XTR II (Green Hex) Burris XTR II (綠色數位蜂巢迷彩) Burris XTR II(绿色蜂巢迷彩) - Burris XTR II (緑ヘックス) + Burris XTR II (緑六角形迷彩) Burris XTR II (Hex Verde) Burris XTR II (Zielony Hex) Burris XTR II (зелёный гекс) @@ -4393,7 +4393,7 @@ EOTech XPS3 (Leśny) EOTech XPS3 (Forêt) EOTech XPS3 (Verdeggiante) - EOTech XPS3 (緑地) + EOTech XPS3 (緑地迷彩) EOTech XPS3 (Grün) EOTech XPS3(繁茂) 이오텍 XPS3 (초목) @@ -4405,7 +4405,7 @@ EOTech XPS3 (Jałowy) EOTech XPS3 (Désert) EOTech XPS3 (Arido) - EOTech XPS3 (乾燥地帯) + EOTech XPS3 (乾燥地帯迷彩) EOTech XPS3 (Trocken) EOTech XPS3(干旱) 이오텍 XPS3 (건조) @@ -4633,7 +4633,7 @@ P90 TR (Mimetica) P90 TR (Terepmintás) P90 TR (Camuflagem) - P90 TR (迷彩) + P90 TR (AAF迷彩) P90 TR (迷彩) P90 TR(迷彩) P90 TR (위장) @@ -4650,7 +4650,7 @@ P90 TR (Hex) P90 TR (Hex) P90 TR (Hex) - P90 TR (ヘックス) + P90 TR (六角形迷彩) P90 TR (數位蜂巢迷彩) P90 TR(蜂巢迷彩) P90 TR (육각) @@ -4701,7 +4701,7 @@ P90 (Mimetica) P90 (Terepmintás) P90 (Camuflagem) - P90 (迷彩) + P90 (AAF迷彩) P90 (迷彩) P90(迷彩) P90 (위장) @@ -4718,7 +4718,7 @@ P90 (Hex) P90 (Hex) P90 (Hex) - P90 (ヘックス) + P90 (六角形迷彩) P90 (數位蜂巢迷彩) P90(蜂巢迷彩) P90 (육각) @@ -4769,7 +4769,7 @@ PS90 TR (Mimetica) PS90 TR (Terepmintás) PS90 TR (Camuflagem) - PS90 TR (迷彩) + PS90 TR (AAF迷彩) PS90 TR (迷彩) PS90 TR(迷彩) PS90 TR (위장) @@ -4786,7 +4786,7 @@ PS90 TR (Hex) PS90 TR (Hex) PS90 TR (Hex) - PS90 TR (ヘックス) + PS90 TR (六角形迷彩) PS90 TR (數位蜂巢迷彩) PS90 TR(蜂巢迷彩) PS90 TR (육각) @@ -4837,7 +4837,7 @@ PS90 (Mimetica) PS90 (Terepmintás) PS90 (Camuflagem) - PS90 (迷彩) + PS90 (AAF迷彩) PS90 (迷彩) PS90(迷彩) PS90 (위장) @@ -4854,7 +4854,7 @@ PS90 (Hex) PS90 (Hex) PS90 (Hex) - PS90 (ヘックス) + PS90 (六角形迷彩) PS90 (數位蜂巢迷彩) PS90(蜂巢迷彩) PS90 (육각) @@ -4958,7 +4958,7 @@ AK-15 (Exuberante) AK-15 (초목) AK-15(繁茂) - AK-15 (緑地) + AK-15 (緑地迷彩) AK-15 (Gür) AK-15 (esőerdő) @@ -4975,7 +4975,7 @@ AK-15 (Árido) AK-15 (건조) AK-15(干旱) - AK-15 (乾燥地帯) + AK-15 (乾燥地帯迷彩) AK-15 (Kurak) AK-15 (sivatag) @@ -5009,7 +5009,7 @@ AK-15 GL (Exuberante) AK-15 GL (초목) AK-15 GP-34(繁茂) - AK-15 GL (緑地) + AK-15 GL (緑地迷彩) AK-15 GL (Gür) AK-15 GL (esőerdő) @@ -5026,7 +5026,7 @@ AK-15 GL (Árido) AK-15 GL (건조) AK-15 GP-34(干旱) - AK-15 GL (乾燥地帯) + AK-15 GL (乾燥地帯迷彩) AK-15AK-15 GL (Kurak) AK-15 GL (sivatag) @@ -5060,7 +5060,7 @@ AK-15K (Exuberante) AK-15K (초목) AK-15K(繁茂) - AK-15K (緑地) + AK-15K (緑地迷彩) AK-15K (Gür) AK-15K (esőerdő) @@ -5077,7 +5077,7 @@ AK-15K (Árido) AK-15K (건조) AK-15K(干旱) - AK-15K (乾燥地帯) + AK-15K (乾燥地帯迷彩) AK-15K (Kurak) AK-15K (sivatag) @@ -5111,7 +5111,7 @@ RPK (Exuberante) RPK (초목) RPK(繁茂) - RPK (緑地) + RPK (緑地迷彩) RPK (Gür) RPK (esőerdő) @@ -5128,7 +5128,7 @@ RPK (Árido) RPK (건조) RPK(干旱) - RPK (乾燥地帯) + RPK (乾燥地帯迷彩) RPK (Kurak) RPK (sivatag) @@ -5213,7 +5213,7 @@ MSBS Grot (Camo) MSBS 그롯 (위장) MSBS Grot(迷彩) - MSBS グロート (迷彩) + MSBS グロート (LDF迷彩) MSBS Grot (Kamuflaj) MSBS Grot (Terepmintás) @@ -5281,7 +5281,7 @@ MSBS Grot GL (Camo) MSBS 그롯 GL (위장) MSBS Grot GPBO-40(迷彩) - MSBS グロート GL (迷彩) + MSBS グロート GL (LDF迷彩) MSBS Grot GL (Kamuflaj) MSBS Grot GL (Terepmintás) @@ -5349,7 +5349,7 @@ MSBS Grot MR (Camo) MSBS 그롯 MR (위장) MSBS Grot MR(迷彩) - MSBS グロート MR (迷彩) + MSBS グロート MR (LDF迷彩) MSBS Grot MR (Kamuflaj) MSBS Grot MR (Terepmintás) @@ -5417,7 +5417,7 @@ MSBS Grot SG (Camo) MSBS 그롯 SG (위장) MSBS Grot SG(迷彩) - MSBS グロート SG (迷彩) + MSBS グロート SG (LDF迷彩) MSBS Grot SG (Kamuflaj) MSBS Grot SG (Terepmintás) diff --git a/addons/rearm/functions/fnc_addRearmActions.sqf b/addons/rearm/functions/fnc_addRearmActions.sqf index e71cab8f0c..200dd2f2b4 100644 --- a/addons/rearm/functions/fnc_addRearmActions.sqf +++ b/addons/rearm/functions/fnc_addRearmActions.sqf @@ -30,7 +30,9 @@ private _cswCarryMagazines = []; private _vehicleActions = []; { private _vehicle = _x; - + private _displayName = getText (configOf _vehicle >> "displayName"); + private _distanceStr = (ACE_player distance _vehicle) toFixed 1; + private _actionName = format ["%1 (%2m)", _displayName, _distanceStr]; // Array of magazines that can be rearmed in the vehicle private _needRearmMags = ([_vehicle] call FUNC(getNeedRearmMagazines)) apply {_x select 0}; @@ -57,7 +59,7 @@ private _vehicleActions = []; // [Level 0] adds a single action to rearm the entire vic private _action = [ _vehicle, - getText(configOf _vehicle >> "displayName"), + _actionName, _icon, {_this call FUNC(rearmEntireVehicle)}, {true}, @@ -84,7 +86,7 @@ private _vehicleActions = []; private _action = [ _vehicle, - getText(configOf _vehicle >> "displayName"), + _actionName, _icon, {}, {true}, diff --git a/addons/rearm/functions/fnc_hasEnoughSupply.sqf b/addons/rearm/functions/fnc_hasEnoughSupply.sqf index c7efb7eca6..8b606bdf6f 100644 --- a/addons/rearm/functions/fnc_hasEnoughSupply.sqf +++ b/addons/rearm/functions/fnc_hasEnoughSupply.sqf @@ -44,7 +44,6 @@ if (GVAR(supply) == 2) exitWith { { _x params ["_magazine", "_rounds"]; if ((_magazine isEqualTo _magazineClass) && (_rounds > 0)) exitWith {_magazinePresent = true; }; - false - } count _magazineSupply; + } forEach _magazineSupply; _magazinePresent }; diff --git a/addons/rearm/functions/fnc_initSupplyVehicle.sqf b/addons/rearm/functions/fnc_initSupplyVehicle.sqf index 7749f0b609..4ab04fcaf6 100644 --- a/addons/rearm/functions/fnc_initSupplyVehicle.sqf +++ b/addons/rearm/functions/fnc_initSupplyVehicle.sqf @@ -33,7 +33,7 @@ if (!alive _vehicle) exitWith {}; private _configSupply = getNumber (_configOf >> QGVAR(defaultSupply)); if (_configSupply == 0) then { - _configSupply = getNumber (_config >> "transportAmmo"); + _configSupply = getNumber (_configOf >> "transportAmmo"); }; private _isSupplyVehicle = _vehicle getVariable [QGVAR(isSupplyVehicle), false]; private _oldRearmConfig = isClass (_configOf >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(takeAmmo)); diff --git a/addons/rearm/functions/fnc_readSupplyCounter.sqf b/addons/rearm/functions/fnc_readSupplyCounter.sqf index 7526fd013a..f298579705 100644 --- a/addons/rearm/functions/fnc_readSupplyCounter.sqf +++ b/addons/rearm/functions/fnc_readSupplyCounter.sqf @@ -58,8 +58,7 @@ if (GVAR(supply) == 1) then { _numChars = _numChars max (count _line); _text = format ["%1
%2", _text, _line]; _supply = _supply + 0.5; - false - } count _magazines; + } forEach _magazines; }; if (_supply > 1.5) then { [[LSTRING(Hint_RemainingAmmo), _text], _supply, _unit, (_numChars/2.9)] call EFUNC(common,displayTextStructured); diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf index d014e9d58d..396b501dab 100644 --- a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf @@ -28,8 +28,7 @@ if (isServer) then { } else { [QGVAR(rearmEntireVehicleSuccessLocalEH), [_truck, _vehicle, _x], _turretOwnerID] call CBA_fnc_ownerEvent; }; - false - } count _turrets; + } forEach _turrets; } else { [QGVAR(rearmEntireVehicleSuccessEH), _this] call CBA_fnc_serverEvent; }; diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index 71802451b7..f41dff6ea9 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -54,7 +54,7 @@ private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMax private _ammoCounts = [_vehicle, _turretPath, _magazineClass] call FUNC(getTurretMagazineAmmo); TRACE_3("start",_magazineClass,_maxMagazines,_ammoCounts); -private _ammoToAdd = if (GVAR(level) == 2) then {_numRounds} else {_rounds}; +private _ammoToAdd = [_rounds, _numRounds] select (GVAR(level) == 2); private _ammoAdded = 0; private _arrayModified = false; // skip needing to remove and re-add mags, if we are only adding new ones diff --git a/addons/rearm/stringtable.xml b/addons/rearm/stringtable.xml index 7ddee1dc83..b8dfd37f77 100644 --- a/addons/rearm/stringtable.xml +++ b/addons/rearm/stringtable.xml @@ -651,7 +651,7 @@ Rearm Cargo Munitionsvorrat - 再武装用カーゴ + 再武装用資源積載量 Ładunek Dozbrajający Munizioni Caricate Боеприпасы для перевооружения @@ -666,7 +666,7 @@ The cargo for rearming (-1 disable) Der Munitionsvorrat, zum Aufmunitionieren von Fahrzeugen (-1 deaktiviert) - カーゴからの再武装 (-1 で無効化) + 再武装に使用する資源の積載量 (-1 で補給無効) Ładunek do dozbrajania (-1 wyłączy) Il carico di munizioni per poter riarmare (-1 per disabilitarlo) Объем боеприпасов для перевооружения (-1 для отмены) @@ -698,7 +698,7 @@ Distance maximale à laquelle un véhicule peut être réarmé. Die maximale Distanz, über die ein Fahrzeug Aufmunitioniert werden kann A distância máxima que um veículo pode ser rearmado/municiado. - 車両から再武装できる範囲を決定します。 + 車両から再武装できる最大距離 與載具之最大可整裝距離 车辆可重新整装的最大距离 La distanza massima da cui un veicolo può essere riarmato diff --git a/addons/recoil/XEH_postInit.sqf b/addons/recoil/XEH_postInit.sqf index 29e5464612..639b22d6f9 100644 --- a/addons/recoil/XEH_postInit.sqf +++ b/addons/recoil/XEH_postInit.sqf @@ -1,4 +1,4 @@ #include "script_component.hpp" // Register fire event handler -["ace_firedPlayer", DFUNC(camShake)] call CBA_fnc_addEventHandler; +["ace_firedPlayer", LINKFUNC(camShake)] call CBA_fnc_addEventHandler; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index 8ffa0eb755..d68da81db7 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -17,14 +17,14 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); #define BASE_POWER 0.40 #define BASE_TIME 0.19 #define BASE_FREQ 13 #define RECOIL_COEF 40 -if (toLower _weapon in ["throw", "put"]) exitWith {}; +if (toLowerANSI _weapon in ["throw", "put"]) exitWith {}; private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); diff --git a/addons/refuel/functions/fnc_canTakeNozzle.sqf b/addons/refuel/functions/fnc_canTakeNozzle.sqf index a2dc39b815..f2fa4a6a9c 100644 --- a/addons/refuel/functions/fnc_canTakeNozzle.sqf +++ b/addons/refuel/functions/fnc_canTakeNozzle.sqf @@ -24,7 +24,7 @@ if (isNull _unit || {!alive _object} || {!isNull (_unit getVariable [QGVAR(nozzle), objNull])} || // Not already carrying a nozzle {(_object getVariable [QGVAR(jerryCan), false]) && {!isNull (_object getVariable [QGVAR(nozzle), objNull])}} || // Prevent jerry cans from being picked up if they have a nozzle connected - {typeOf _object == QGVAR(fuelNozzle) && {!isNull (attachedTo _object)}} || // Not carried by someone else + {!([_unit, _object, [INTERACT_EXCEPTIONS]] call EFUNC(common,canInteractWith))} || // Not carried by someone else {([_unit, _object] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE}) exitWith {false}; !(_object getVariable [QGVAR(isConnected), false]) && {!(_unit getVariable [QGVAR(isRefueling), false])} diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index ad658492fa..502e1dc3a4 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -116,6 +116,9 @@ private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL); // Reset fuel counter _source setVariable [QGVAR(fuelCounter), 0, true]; + // Let other players access nozzle + [objNull, _nozzle] call EFUNC(common,claim); + [_unit, _sink, _nozzle, _endPosTestOffset] call FUNC(refuel); private _canReceive = getNumber ((configOf _sink) >> QGVAR(canReceive)) == 1; diff --git a/addons/refuel/functions/fnc_dropNozzle.sqf b/addons/refuel/functions/fnc_dropNozzle.sqf index 5ca375dc29..ee37a869e1 100644 --- a/addons/refuel/functions/fnc_dropNozzle.sqf +++ b/addons/refuel/functions/fnc_dropNozzle.sqf @@ -24,6 +24,9 @@ TRACE_3("dropNozzle",_unit,_nozzle,_disconnectOnly); detach _nozzle; _nozzle setVariable [QGVAR(isRefueling), false, true]; +// Remove claim on nozzle +[objNull, _nozzle] call EFUNC(common,claim); + if (_disconnectOnly) exitWith {}; _nozzle setVelocity [0, 0, 0]; diff --git a/addons/refuel/functions/fnc_getCapacity.sqf b/addons/refuel/functions/fnc_getCapacity.sqf index 94681480ae..c6218831da 100644 --- a/addons/refuel/functions/fnc_getCapacity.sqf +++ b/addons/refuel/functions/fnc_getCapacity.sqf @@ -30,7 +30,7 @@ if (isNil "_capacity") then { // Set capacity even if this isn't a fuel source to save on config lookup time in the event this function is used in a loop _source setVariable [QGVAR(capacity), _capacity, true]; // handle weird edge case when trying to run on "camera"/CfgNonAIVehicles which won't support setVariable and will inf-loop - if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1", _this); }; + if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1",_this); }; [_source, _capacity] call FUNC(setFuel); }; diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf index d2f1e2aaa5..611fa85e90 100644 --- a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -35,11 +35,9 @@ TRACE_2("start",_unit,_nozzle); _args params ["_unit", "_nozzle"]; if !( - alive _unit + _unit call EFUNC(common,isAwake) && {"" isEqualTo currentWeapon _unit || {_unit call EFUNC(common,isSwimming)}} && {[_unit, objNull, [INTERACT_EXCEPTIONS, "notOnMap"]] call EFUNC(common,canInteractWith)} - && {"unconscious" isNotEqualTo toLower animationState _unit} - && {!(_unit getVariable ["ACE_isUnconscious", false])} ) exitWith { TRACE_3("stop dead/weapon/interact/uncon",_unit,alive _unit,currentWeapon _unit); DROP_NOZZLE diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index 8eb0a16f1f..cd8f8b4eb4 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -32,17 +32,23 @@ params [ private _source = _object; private _nozzle = _object; - if (typeOf _object isEqualTo QGVAR(fuelNozzle) || {_object getVariable [QGVAR(jerryCan), false]}) then { // func is called on muzzle either connected or on ground + if (typeOf _object isEqualTo QGVAR(fuelNozzle) || {_object getVariable [QGVAR(jerryCan), false]}) then { // func is called on nozzle either connected or on ground _source = _nozzle getVariable QGVAR(source); if (_nozzle getVariable [QGVAR(jerryCan), false]) then { _nozzle attachTo [_unit, [0,1,0], "pelvis"]; } else { _nozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"]; }; + + // Don't allow other players to take nozzle + [_unit, _nozzle] call EFUNC(common,claim); } else { // func is called on fuel truck _nozzle = QGVAR(fuelNozzle) createVehicle [0,0,0]; _nozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"]; + // Don't allow other players to take nozzle + [_unit, _nozzle] call EFUNC(common,claim); + private _ropeTarget = _source; if !(_source isKindOf "AllVehicles") then { private _helper = QGVAR(helper) createVehicle [0,0,0]; diff --git a/addons/refuel/stringtable.xml b/addons/refuel/stringtable.xml index ed9b139593..909a3f4587 100644 --- a/addons/refuel/stringtable.xml +++ b/addons/refuel/stringtable.xml @@ -58,6 +58,7 @@ Prędkość Tankowania Ładunku Frachtflussrate Vitesse de ravitaillement + Скорость заполнения груза How fast should a fuel source's tank be filled? @@ -68,6 +69,7 @@ Jak szybko zbiornik paliwa powinien być napełniany? Wie schnell sollte der Tank einer Kraftstoffquelle gefüllt werden? A quelle vitesse le réservoir de carburant doit-il être rempli ? + Как быстро должен заполняться бак источника топлива? Refuel @@ -318,6 +320,7 @@ 給油を始める (コンテナ) Rozpocznij tankowanie (zbiornik) Commencer le ravitaillement (container) + Начать заправку топливом (контейнер) Couldn't turn on fuel nozzle @@ -501,6 +504,8 @@ Raccogli contenitore di carburante 燃料キャニスターを持つ 연료통 집어들기 + Взять канистру с топливом + Ramasser le réservoir de carburant Picking fuel canister up... @@ -508,6 +513,8 @@ Raccogliendo contenitore di carburante... 燃料キャニスターを持ち上げています・・・ 연료통 집어드는 중... + Поднимаю канистру с топливом... + Ramasser les bidons de carburant... Connect fuel canister @@ -515,6 +522,8 @@ Collega contenitore di carburante 燃料キャニスターを接続する 연료통 꽂기 + Подсоединить канистру с топливом + Raccorder le réservoir de carburant Connecting fuel canister... @@ -522,6 +531,8 @@ Collegando contenitore di carburante... 燃料キャニスターを接続しています・・・ 연료통 꽂는 중... + Подсоединение топливной канистры... + Raccorder le réservoir de carburant... Disconnect fuel canister @@ -529,6 +540,8 @@ Scollega contenitore di carburante 燃料キャニスターを外します 연료통 빼기 + Отсоединить канистру с топливом + Débrancher le réservoir de carburant Refuel hose length @@ -553,7 +566,7 @@ Время взаимодействия со шлангом Tiempo de interacción con la Bomba/Manguera Tempo di interazione Pompa/Pistola - ポンプとホースのインタラクション所要時間 + ポンプ/ホースのインタラクション所要時間 Czas Interakcji z Pompą/Wężem Interaktionszeit zwischen Pumpe und Schlauch Temps d'interaction pompe/tuyau @@ -565,7 +578,7 @@ Время в секундах, которое занимает взаимодействие со шлангом. Cuanto tiempo en segundos tardan las interacciones de repostado. Durata delle interazioni in secondi. - 燃料補給に掛かる時間 (秒) + 燃料補給に掛かる時間。 (秒単位) Jak długo powinna trwać interakcja tankowania w sekundach. Wie lange Auftank-Interaktionen in Sekunden dauern. Durée des interactions de ravitaillement en secondes. @@ -574,7 +587,7 @@ Fuel Cargo Volume Tankvolumen Объем топлива для заправки - 貯油量 + 給油用燃料積載量 Capacità di Carico Carburante 儲油量 储油量 @@ -591,7 +604,7 @@ The fuel volume available for refueling (-1 disable, -10 if infinite) Das Tankvolumen, welches zum Nachtanken verfügbar ist (-1 deaktiviert, -10 unendlich) Объем топлива, доступный для заправки других машин (-1 отключить, -10 если неограничен) - 給油用の貯油量を設定できます (-1で無効、-10で無限) + 給油に使用する燃料の積載量 (-1で補給無効、-10で無限補給) La capacità di carburante disponibile al rifornimento altrui (-1 disabilita, -10 se infinito) 設定有多少油料可供載具進行加油(-1時關閉,-10為無限油量) 设定有多少油料可供载具进行加油(-1时关闭,-10为无限油量) diff --git a/addons/reload/CfgVehicles.hpp b/addons/reload/CfgVehicles.hpp index 22086ad867..5a05f03734 100644 --- a/addons/reload/CfgVehicles.hpp +++ b/addons/reload/CfgVehicles.hpp @@ -45,5 +45,48 @@ class CfgVehicles { }; }; }; + + class ACE_SelfActions { + class GVAR(reloadTurret) { + displayName = "$STR_controls_tooltips_RELOAD_MAGAZINE"; + condition = QUOTE(call FUNC(canSwapTurretMagazine)); + statement = QUOTE(call FUNC(swapTurretMagazine)); + icon = "\A3\ui_f\data\igui\cfg\simpletasks\types\rearm_ca.paa"; + }; + }; + }; + + class Tank: LandVehicle { + class ACE_SelfActions { + class GVAR(reloadTurret) { + displayName = "$STR_controls_tooltips_RELOAD_MAGAZINE"; + condition = QUOTE(call FUNC(canSwapTurretMagazine)); + statement = QUOTE(call FUNC(swapTurretMagazine)); + icon = "\A3\ui_f\data\igui\cfg\simpletasks\types\rearm_ca.paa"; + }; + }; + }; + + class Car: LandVehicle { + class ACE_SelfActions { + class GVAR(reloadTurret) { + displayName = "$STR_controls_tooltips_RELOAD_MAGAZINE"; + condition = QUOTE(call FUNC(canSwapTurretMagazine)); + statement = QUOTE(call FUNC(swapTurretMagazine)); + icon = "\A3\ui_f\data\igui\cfg\simpletasks\types\rearm_ca.paa"; + }; + }; + }; + + class Air; + class Helicopter: Air { + class ACE_SelfActions { + class GVAR(reloadTurret) { + displayName = "$STR_controls_tooltips_RELOAD_MAGAZINE"; + condition = QUOTE(call FUNC(canSwapTurretMagazine)); + statement = QUOTE(call FUNC(swapTurretMagazine)); + icon = "\A3\ui_f\data\igui\cfg\simpletasks\types\rearm_ca.paa"; + }; + }; }; }; diff --git a/addons/reload/CfgWeapons.hpp b/addons/reload/CfgWeapons.hpp new file mode 100644 index 0000000000..0d52ae8f5c --- /dev/null +++ b/addons/reload/CfgWeapons.hpp @@ -0,0 +1,16 @@ +class CfgWeapons { + class HMG_01; + class HMG_static: HMG_01 { + type = 1; // makes it possible to swap to the fullest magazine + }; + + class GMG_F; + class GMG_20mm: GMG_F { + type = 1; + }; + + class CannonCore; + class mortar_82mm: CannonCore { + type = 1; + }; +}; diff --git a/addons/reload/XEH_PREP.hpp b/addons/reload/XEH_PREP.hpp index 578bc2ce9f..1a62a9f5bd 100644 --- a/addons/reload/XEH_PREP.hpp +++ b/addons/reload/XEH_PREP.hpp @@ -1,7 +1,9 @@ PREP(canCheckAmmo); PREP(canCheckAmmoSelf); +PREP(canSwapTurretMagazine); PREP(getAmmoToLinkBelt); PREP(checkAmmo); PREP(displayAmmo); PREP(onTake); PREP(startLinkingBelt); +PREP(swapTurretMagazine); diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 02dedd14c3..a219efed0a 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -53,3 +53,18 @@ if (!hasInterface) exitWith {}; #include "initKeybinds.inc.sqf" + +// Reload when default reload keybind is pressed +addUserActionEventHandler ["ReloadMagazine", "Activate", { + private _vehicle = objectParent ACE_player; + + // If on foot, skip + if (isNull _vehicle) exitWith {}; + + // weaponState is only updated after 3 frames, so wait to run checks in case we're doing an engine reload at the same time + [{ + if !(_this call FUNC(canSwapTurretMagazine)) exitWith {}; + + _this call FUNC(swapTurretMagazine); + }, [_vehicle, ACE_player], 3] call CBA_fnc_execAfterNFrames; +}]; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 1cd11c5b17..f4871f1354 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -14,10 +14,11 @@ class CfgPatches { }; }; -#include "ACE_Arsenal_Stats.hpp" -#include "CfgVehicles.hpp" -#include "CfgMagazines.hpp" -#include "CfgEventHandlers.hpp" #include "CfgActions.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "ACE_Arsenal_Stats.hpp" #include "ACE_Settings.hpp" #include "ACE_UI.hpp" diff --git a/addons/reload/functions/fnc_canSwapTurretMagazine.sqf b/addons/reload/functions/fnc_canSwapTurretMagazine.sqf new file mode 100644 index 0000000000..114a124776 --- /dev/null +++ b/addons/reload/functions/fnc_canSwapTurretMagazine.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror, johnb43 + * Check if the player can reload their vehicle's magazine to one with more ammo. + * + * Arguments: + * 0: Vehicle + * 1: Player + * + * Return Value: + * Can swap turret magazine + * + * Example: + * [vehicle player, player] call ace_reload_fnc_canSwapTurretMagazine + * + * Public: No + */ + +params ["_vehicle", "_unit"]; +TRACE_2("canSwapTurretMagazine",_vehicle,_unit); + +private _turretPath = _vehicle unitTurret _unit; +if (_turretPath in [[-1], []]) exitWith {false}; // skip driver / cargo +if !(_vehicle turretLocal _turretPath) exitWith {false}; // just to be safe + +(weaponState [_vehicle, _turretPath]) params ["_weapon", "_muzzle", "", "_magazine", "_ammoCount", "_roundReloadPhase", "_magazineReloadPhase"]; +TRACE_5("",_weapon,_muzzle,_magazine,_ammoCount,typeOf _vehicle); + +if ((_weapon == "") || {_weapon != _muzzle}) exitWith {false}; // skip multi-muzzle (he/ap auto-cannons) +if (_magazine == "") exitWith {false}; +if (_roundReloadPhase + _magazineReloadPhase != 0) exitWith {false}; // can't reload while already reloading or while shooting +if (isText (configFile >> "CfgMagazines" >> _magazine >> "pylonWeapon")) exitWith {false}; +if (getNumber (configFile >> "CfgWeapons" >> _weapon >> "type") % 2 == 1) exitWith {false}; // engine support for magazine swapping + +private _maxAmmo = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); +if ((_ammoCount == 0) || {_ammoCount == _maxAmmo}) exitWith {false}; + +private _magAmmoCounts = []; + +// Get count of rounds in magazines +{ + _x params ["_xMag", "_xTurret", "_xAmmo"]; + + if ((_xMag == _magazine) && {_xTurret isEqualTo _turretPath}) then { + _magAmmoCounts pushBack _xAmmo; + }; +} forEach (magazinesAllTurrets _vehicle); + +TRACE_1("",_magAmmoCounts); + +// Select maximum +(selectMax _magAmmoCounts) > _ammoCount diff --git a/addons/reload/functions/fnc_swapTurretMagazine.sqf b/addons/reload/functions/fnc_swapTurretMagazine.sqf new file mode 100644 index 0000000000..c4574398d1 --- /dev/null +++ b/addons/reload/functions/fnc_swapTurretMagazine.sqf @@ -0,0 +1,43 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror, johnb43 + * Reloads a vehicles turret to a new magazine. + * + * Arguments: + * 0: Vehicle + * 1: Player + * + * Return Value: + * None + * + * Example: + * [vehicle player, player] call ace_reload_fnc_swapTurretMagazine + * + * Public: No + */ + +params ["_vehicle", "_unit"]; +TRACE_2("swapTurretMagazine",_vehicle,_unit); + +private _turretPath = _vehicle unitTurret _unit; +(weaponState [_vehicle, _turretPath]) params ["_weapon", "_muzzle", "", "_magazine"]; +TRACE_3("",_weapon,_magazine,typeOf _vehicle); + +private _magazinesAllTurrets = []; + +// Get magazines that are of the correct type; Exclude empty mags +{ + _x params ["_xMag", "_xTurret", "_xAmmo"]; + + if ((_xMag == _magazine) && {_xTurret isEqualTo _turretPath} && {_xAmmo > 0}) then { + _magazinesAllTurrets pushBack _x; + }; +} forEach (magazinesAllTurrets _vehicle); + +// Get count of rounds in magazines, then select maximum +private _magAmmoCounts = _magazinesAllTurrets apply {_x select 2}; +private _mag = _magazinesAllTurrets select (_magAmmoCounts find (selectMax _magAmmoCounts)); + +TRACE_2("",_magAmmoCounts,_mag); + +_unit action ["loadMagazine", _vehicle, _unit, _mag select 4, _mag select 3, _weapon, _muzzle]; diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index f52c5107e7..e081834e29 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -137,6 +137,7 @@ ベルトがリンクされた Taśma została połączona 탄띠가 연결되었습니다 + Ремень был пристегнут Belt could not be linked @@ -146,6 +147,7 @@ ベルトはリンクされなかった Taśma nie mogła być połączona 탄띠를 연결할 수 없습니다 + Ремень не удалось пристегнуть diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index 5d3567e5ef..ac42ef4d99 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -9,6 +9,7 @@ Mostra avviso di ricarica da parte del coppio 동료의 장전에 대한 알림 표시 Affichage de notifications lors d'une rechargement par un ami + Отображает уведомления о загрузке помощника Displays notifications when an assistant loads a gunner's launcher. @@ -18,6 +19,7 @@ Mostra un avviso quando un assistente sta ricaricando il proprio lanciatore. 부사수가 사수의 발사기를 장전할 때 알림을 표시합니다. Affiche une notofication lorsqu'un assistant recharge l'arme du tireur. + Отображает уведомления, когда помощник загружает пусковую установку стрелка. Load launcher @@ -44,6 +46,7 @@ %1 がランチャーを装填しています %1 ładuje twoją wyrzutnię %1이(가) 당신의 발사기를 장전했습니다. + %1 загружает Вашу установку %1 stopped loading your launcher @@ -53,6 +56,7 @@ %1 がランチャーの装填を中断しました %1 przestał ładować twoją wyrzutnię %1이(가) 당신의 발사기 장전을 멈췄습니다. + %1 прекратил загружать Вашу установку Loading launcher... @@ -113,6 +117,7 @@ ランチャーを装填できませんでした Wyrzutnia nie mogła być załadowana 발사기를 장전할 수 없습니다. + Не удалось загрузить пусковую установку Buddy Loading @@ -122,6 +127,7 @@ Chargement par un ami Nachladen durch Kamerad バディローディング + Перезарядка помощником diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 58bb1be6e5..2e9a9178ff 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -2,10 +2,10 @@ ["CBA_settingsInitialized", { - if !GVAR(enabled) exitWith {}; + if (!GVAR(enabled)) exitWith {}; - [QGVAR(setVehicleDamage), {_this call FUNC(setDamage)}] call CBA_fnc_addEventHandler; - [QGVAR(setVehicleHitPointDamage), {_this call FUNC(setHitPointDamage)}] call CBA_fnc_addEventHandler; + [QGVAR(setVehicleDamage), LINKFUNC(setDamage)] call CBA_fnc_addEventHandler; + [QGVAR(setVehicleHitPointDamage), LINKFUNC(setHitPointDamage)] call CBA_fnc_addEventHandler; [QGVAR(setWheelHitPointDamage), { params ["_object", "_hitPoint", "_damage"]; private _damageDisabled = !isDamageAllowed _object; diff --git a/addons/repair/dev/draw_showRepairInfo.sqf b/addons/repair/dev/draw_showRepairInfo.sqf index f516e14ef9..20bf748e7f 100644 --- a/addons/repair/dev/draw_showRepairInfo.sqf +++ b/addons/repair/dev/draw_showRepairInfo.sqf @@ -20,7 +20,7 @@ addMissionEventHandler ["Draw3D", { private _hitpoint = _hitPoints select _forEachIndex; if ((_selection != "") && {_hitPoint != ""}) then { - if (((toLower _hitPoint) find "glass") != -1) exitWith {}; + if ("glass" in (toLowerANSI _hitPoint)) exitWith {}; private _info = ""; private _color = [1,0,0,1]; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index d071f577a6..9dad1ecc31 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -23,7 +23,7 @@ if !(hasInterface && {GVAR(enabled)}) exitWith {}; params ["_vehicle"]; private _type = typeOf _vehicle; -TRACE_2("addRepairActions", _vehicle,_type); +TRACE_2("addRepairActions",_vehicle,_type); // do nothing if the class is already initialized private _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); @@ -52,7 +52,7 @@ private _turretPaths = ((fullCrew [_vehicle, "gunner", true]) + (fullCrew [_vehi { private _selection = _x; - private _hitpoint = toLower (_hitPoints select _forEachIndex); + private _hitpoint = toLowerANSI (_hitPoints select _forEachIndex); // Skip ignored selections if (_forEachIndex in _selectionsToIgnore) then { diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index 264baf9ef0..f1f4aa7b7c 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -38,7 +38,7 @@ private _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false}; private _items = _config call FUNC(getRepairItems); -if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; +if (_items isNotEqualTo [] && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; private _return = true; if (getText (_config >> "condition") != "") then { diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf index d02ab33fb7..58dd4590bb 100644 --- a/addons/repair/functions/fnc_doRepair.sqf +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -35,7 +35,7 @@ private _hitPointNewDamage = (_hitPointCurDamage - 0.5) max _postRepairDamageMin if (_hitPointNewDamage < _hitPointCurDamage) then { // raise event to set the new hitpoint damage - TRACE_3("repairing main point", _vehicle, _hitPointIndex, _hitPointNewDamage); + TRACE_3("repairing main point",_vehicle,_hitPointIndex,_hitPointNewDamage); [QGVAR(setVehicleHitPointDamage), [_vehicle, _hitPointIndex, _hitPointNewDamage], _vehicle] call CBA_fnc_targetEvent; _hitPointCurDamage = _hitPointNewDamage; }; @@ -57,7 +57,7 @@ if (isArray _hitpointGroupConfig) then { private _subPointCurDamage = _vehicle getHitIndex _hitPointIndex; private _subPointNewDamage = (_subPointCurDamage - 0.5) max _postRepairDamageMin; if (_subPointNewDamage < _subPointCurDamage) then { - TRACE_3("repairing sub point", _vehicle, _subHitIndex, _subPointNewDamage); + TRACE_3("repairing sub point",_vehicle,_subHitIndex,_subPointNewDamage); [QGVAR(setVehicleHitPointDamage), [_vehicle, _subHitIndex, _subPointNewDamage], _vehicle] call CBA_fnc_targetEvent; }; }; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index a970488268..519a3f78d6 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track", _claimedObjects); + ERROR_1("Bad Track",_claimedObjects); }; // can't use a destroyed track diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index d52072b647..a512089c89 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_track", objNull]]; if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - ERROR_1("Bad Track", _claimedObjects); + ERROR_1("Bad Track",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index 98c3d95cf9..7ec617127c 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -26,7 +26,7 @@ TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); _claimedObjects params [["_wheel", objNull]]; if ((isNull _wheel) || {!([_unit, _wheel, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { - WARNING_1("Bad Claimed Wheel", _claimedObjects); + WARNING_1("Bad Claimed Wheel",_claimedObjects); }; // get current hitpoint damage diff --git a/addons/repair/functions/fnc_getHitPointString.sqf b/addons/repair/functions/fnc_getHitPointString.sqf index 5611a6f4e3..23a57f8895 100644 --- a/addons/repair/functions/fnc_getHitPointString.sqf +++ b/addons/repair/functions/fnc_getHitPointString.sqf @@ -20,17 +20,9 @@ */ params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]]; +_trackArray params [["_trackNames", []], ["_trackStrings", []], ["_trackAmount", []]]; -private _track = (count _trackArray > 0); -private _trackNames = []; -private _trackStrings = []; -private _trackAmount = []; - -if (_track) then { - _trackNames = _trackArray select 0; - _trackStrings = _trackArray select 1; - _trackAmount = _trackArray select 2; -}; +private _track = _trackArray isNotEqualTo []; // Prepare first part of the string from stringtable //IGNORE_STRING_WARNING(str_ace_repair_hit); @@ -40,7 +32,7 @@ private _text = LSTRING(Hit); if ((_hitpoint select [0, 1]) == "#") then { _hitPoint = _hitPoint select [1] }; // Remove "Hit" from hitpoint name if one exists -private _toFind = if ((toLower _hitPoint) find "hit" == 0) then { +private _toFind = if ((toLowerANSI _hitPoint) find "hit" == 0) then { [_hitPoint, 3] call CBA_fnc_substr } else { _hitPoint @@ -86,7 +78,7 @@ for "_i" from 0 to (count _hitPoint) do { // Don't display part name if no string is found in stringtable if (_text == LSTRING(Hit)) then { - if (_hitPoint != "") then { LOG_1("Hitpoint [%1] - could not be localized", _hitPoint); }; + if (_hitPoint != "") then { LOG_1("Hitpoint [%1] - could not be localized",_hitPoint); }; _text = _textDefault; }; diff --git a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf index d455950a3b..08ca639a20 100644 --- a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf +++ b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf @@ -35,7 +35,7 @@ private _processedSelections = []; { private _selection = _x; - private _hitpoint = toLower (_hitPoints select _forEachIndex); + private _hitpoint = toLowerANSI (_hitPoints select _forEachIndex); private _isWheelOrTrack = _selection in _wheelHitSelections || {_hitpoint in _wheelHitPoints} || {_hitpoint in TRACK_HITPOINTS}; if (_hitpoint isEqualTo "") then { // skip empty hitpoint @@ -134,7 +134,7 @@ private _processedSelections = []; continue }; - if (ANY_OF(_hitpointGroups, ANY_OF(_x select 1, _x == _hitpoint))) then { // skip child hitpoints + if (ANY_OF(_hitpointGroups,ANY_OF(_x select 1,_x == _hitpoint))) then { // skip child hitpoints TRACE_3("Skipping child hitpoint",_hitpoint,_forEachIndex,_selection); /*#ifdef DEBUG_MODE_FULL systemChat format ["Skipping child hitpoint, hitpoint %1, index %2, selection %3", _hitpoint, _forEachIndex, _selection]; diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf index 1952707204..5d655887c6 100644 --- a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf +++ b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -50,7 +50,7 @@ private _wheelHitPointSelections = []; if ((_wheelBoneNameResized != "") && {_x find _wheelBoneNameResized == 0}) exitWith { // same as above. Requirement for physx. _wheelHitPoint = _hitPoints select _forEachIndex; _wheelHitPointSelection = _hitPointSelections select _forEachIndex; - TRACE_2("wheel found [Orginal]", _wheelName, _wheelHitPoint); + TRACE_2("wheel found [Orginal]",_wheelName,_wheelHitPoint); }; } forEach _hitPointSelections; @@ -68,7 +68,7 @@ private _wheelHitPointSelections = []; { if (_x != "") then { //Filter out things that definitly aren't wheeels (#3759) - if ((toLower (_hitPoints select _forEachIndex)) in ["hitengine", "hitfuel", "hitbody"]) exitWith {TRACE_1("filter",_x)}; + if ((toLowerANSI (_hitPoints select _forEachIndex)) in ["hitengine", "hitfuel", "hitbody"]) exitWith {TRACE_1("filter",_x)}; private _xPos = _vehicle selectionPosition _x; if (_xPos isEqualTo [0,0,0]) exitWith {}; private _xDist = _wheelCenterPos distance _xPos; @@ -83,7 +83,7 @@ private _wheelHitPointSelections = []; if (_bestIndex != -1) then { _wheelHitPoint = _hitPoints select _bestIndex; _wheelHitPointSelection = _hitPointSelections select _bestIndex; - TRACE_2("wheel found [Backup]", _wheelName, _wheelHitPoint); + TRACE_2("wheel found [Backup]",_wheelName,_wheelHitPoint); }; }; }; diff --git a/addons/repair/functions/fnc_isEngineer.sqf b/addons/repair/functions/fnc_isEngineer.sqf index 2a013bccda..2962e4f8ad 100644 --- a/addons/repair/functions/fnc_isEngineer.sqf +++ b/addons/repair/functions/fnc_isEngineer.sqf @@ -22,7 +22,7 @@ private _class = _unit getVariable ["ACE_IsEngineer", _unit getUnitTrait "engine // This if statement is here for copmatability with the common variant of isEngineer, which requires a bool. // We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module. -if (_class isEqualType false) then {_class = [0, 1] select _class}; +if (_class isEqualType false) then {_class = parseNumber _class}; TRACE_3("isEngineer",_unit,_engineerN,_class); if (_class >= _engineerN) exitWith {true}; diff --git a/addons/repair/functions/fnc_isInRepairFacility.sqf b/addons/repair/functions/fnc_isInRepairFacility.sqf index 7ea8ace60f..51cc5424bb 100644 --- a/addons/repair/functions/fnc_isInRepairFacility.sqf +++ b/addons/repair/functions/fnc_isInRepairFacility.sqf @@ -34,7 +34,7 @@ private _checkObject = { private _fnc_check = { private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; - CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position, _position vectorAdd [ARR_3(0, 0, 10)], _unit)]) + CHECK_OBJECTS(lineIntersectsWith [ARR_3(_position,_position vectorAdd [ARR_3(0,0,10)],_unit)]) || {CHECK_OBJECTS(_unit nearObjects 7.5)} }; diff --git a/addons/repair/functions/fnc_moduleAddSpareParts.sqf b/addons/repair/functions/fnc_moduleAddSpareParts.sqf index bccccdcc22..cb6da371d7 100644 --- a/addons/repair/functions/fnc_moduleAddSpareParts.sqf +++ b/addons/repair/functions/fnc_moduleAddSpareParts.sqf @@ -30,8 +30,7 @@ if (!isNull _logic) then { // Add synchronized objects to list { _list pushBack _x; - nil - } count (synchronizedObjects _logic); + } forEach (synchronizedObjects _logic); if (_list isEqualTo []) exitWith {}; @@ -40,6 +39,5 @@ if (!isNull _logic) then { // Add spare parts { [_x, _amount, _part, true] call FUNC(addSpareParts); - false - } count _list; + } forEach _list; }; diff --git a/addons/repair/functions/fnc_normalizeHitPoints.sqf b/addons/repair/functions/fnc_normalizeHitPoints.sqf index 9abeec718c..5e61ef8c88 100644 --- a/addons/repair/functions/fnc_normalizeHitPoints.sqf +++ b/addons/repair/functions/fnc_normalizeHitPoints.sqf @@ -16,10 +16,10 @@ */ params ["_vehicle"]; -TRACE_2("params",_vehicle, typeOf _vehicle); +TRACE_2("params",_vehicle,typeOf _vehicle); // Can't execute all commands if the vehicle isn't local, exit if that's so -if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1", _vehicle);}; +if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1",_vehicle);}; (getAllHitPointsDamage _vehicle) params [["_allHitPoints", []]]; @@ -57,7 +57,7 @@ total = damage _vehicle; // apply normalized damage to all dependand hitpoints { private _damage = call (_dependentHitPointScripts select _forEachIndex); - TRACE_2("setting depend hitpoint", _x, _damage); + TRACE_2("setting depend hitpoint",_x,_damage); _vehicle setHitPointDamage [_x, _damage]; } forEach _dependentHitPoints; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index a86f8f22db..86ff191000 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -44,7 +44,7 @@ if ((isEngineOn _target) && {!GVAR(autoShutOffEngineWhenStartingRepair)}) exitWi }; private _items = _config call FUNC(getRepairItems); -if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; +if (_items isNotEqualTo [] && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; private _return = true; if (getText (_config >> "condition") != "") then { @@ -107,7 +107,7 @@ if !(_return && alive _target) exitWith {false}; //Claim required objects { - TRACE_2("Claiming", _x, (typeOf _x)); + TRACE_2("Claiming",_x,(typeOf _x)); [_caller, _x, false] call EFUNC(common,claim); } forEach _claimObjectsAvailable; @@ -172,7 +172,7 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { } else { _caller setVariable [QGVAR(repairPrevAnimCaller), animationState _caller]; }; - _caller setVariable [QGVAR(repairCurrentAnimCaller), toLower _callerAnim]; + _caller setVariable [QGVAR(repairCurrentAnimCaller), toLowerANSI _callerAnim]; [_caller, _callerAnim] call EFUNC(common,doAnimation); }; }; diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index ce8d29b25d..c305c90b6b 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -51,7 +51,7 @@ if (_weaponSelect != "") then { //Unclaim repair objects: { - TRACE_2("Releasing", _x, (typeOf _x)); + TRACE_2("Releasing",_x,(typeOf _x)); [objNull, _x, false] call EFUNC(common,claim); } forEach _claimedObjects; diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 083daa6cc7..271d662cd4 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -47,7 +47,7 @@ if (_weaponSelect != "") then { //Unclaim repair objects: { - TRACE_2("Releasing", _x, (typeOf _x)); + TRACE_2("Releasing",_x,(typeOf _x)); [objNull, _x, false] call EFUNC(common,claim); } forEach _claimedObjects; diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index 9a28adc211..0a6051e084 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -23,13 +23,13 @@ params ["_vehicle", "_hitPointIndex", "_hitPointDamage", ["_useEffects", false]] TRACE_4("params",_vehicle,typeOf _vehicle,_hitPointIndex,_hitPointDamage); // can't execute all commands if the vehicle isn't local. exit here. -if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1", _vehicle);}; +if !(local _vehicle) exitWith {ERROR_1("Vehicle Not Local %1",_vehicle);}; // get all hitpoints and selections and damages (getAllHitPointsDamage _vehicle) params [["_allHitPoints", []], ["_allHitPointsSelections", []], ["_allHitPointDamages", []]]; // exit if the hitpoint is not valid -if ((_hitPointIndex < 0) || {_hitPointIndex >= (count _allHitPoints)}) exitWith {ERROR_2("NOT A VALID HITPOINT: %1-%2", _hitPointIndex,_vehicle);}; +if ((_hitPointIndex < 0) || {_hitPointIndex >= (count _allHitPoints)}) exitWith {ERROR_2("NOT A VALID HITPOINT: %1-%2",_hitPointIndex,_vehicle);}; // save structural damage and sum of hitpoint damages @@ -44,7 +44,7 @@ private _hitPointDamageRepaired = 0; //positive for repairs : newSum = (oldSum - if ((!isNil {_vehicle getHit _selectionName}) && {_x != ""}) then { _realHitpointCount = _realHitpointCount + 1; - if ((((toLower _x) find "glass") == -1) && {(getText (configOf _vehicle >> "HitPoints" >> _x >> "depends")) in ["", "0"]}) then { + if (!("glass" in (toLowerANSI _x)) && {(getText (configOf _vehicle >> "HitPoints" >> _x >> "depends")) in ["", "0"]}) then { _hitPointDamageSumOld = _hitPointDamageSumOld + (_allHitPointDamages select _forEachIndex); if (_forEachIndex == _hitPointIndex) then { _hitPointDamageRepaired = (_allHitPointDamages select _forEachIndex) - _hitPointDamage; diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 6bf0092a55..775202ed3a 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -44,6 +44,7 @@ Ruota 바퀴 Roue + Колесо Change Wheel @@ -279,6 +280,7 @@ Coefficiente di riparazione completa 전체 수리 시간 계수 Coefficient du temps de réparation complète + Коэффициент времени полного ремонта Modifies how long it takes to perform a Full Repair.\nThe repair time is based on the amount of repairs needed for each part, including those normally inaccessible. @@ -288,6 +290,7 @@ Ändert, wie lange es dauert, eine vollständige Reparatur durchzuführen.\nDie Reparaturzeit basiert auf der Menge der erforderlichen Reparaturen für jedes Teil, einschließlich derjenigen, die normalerweise nicht zugänglich sind. 전체적인 수리를 수행하는 데 걸리는 시간을 수정합니다.\n수리 시간은 일반적으로 접근할 수 없는 부품을 포함하여 각 부품에 필요한 수리 시간을 기준으로 합니다. Modifie la durée que prend une réparation complète.\nLe temps de réparation est basé sur la quantité de réparations requises pour chaque partie, incluant celles qui sont normalement inaccessibles. + Изменяет время, необходимое для выполнения полного ремонта.\nВремя ремонта зависит от объема ремонтных работ, необходимых для каждой детали, включая те, которые обычно недоступны. Boost engineer training when in repair vehicles or facilities. Untrained becomes engineer, engineer becomes advanced engineer. @@ -311,7 +314,7 @@ Lugares de reparación completa Luoghi Riparazione Completa Endroits pour réparation complète - 完全修理できる場所 + 完全修理可能な場所 완전수리 구역 完整维修地点 完整維修地點 @@ -390,7 +393,7 @@ Přidat náhradní díly do vozidla (vyžaduje úložný prostor)? Aggiungi parti di ricambio ai veicoli (richiede spazio nel carico)? Ajoute des pièces de rechange aux véhicules (nécessite le système de cargaison). - 車両へ予備部品を追加しますか? (カーゴ コンポーネントが必要) + 車両へ予備部品を追加しますか? (貨物室が必要) 차량에 예비 부품을 더합니까?(짐칸 요소 필요) 添加载具备件(需相关货物组件)? 添加載具備件 (需相關貨物組件)? @@ -598,7 +601,7 @@ Hell Světlá Claro - 밝은 + 조명 轻型 照明 Işık @@ -1283,6 +1286,7 @@ Zezwól na Łatanie Kół 바퀴 수리 허용 Autoriser le rafistolage des roues + Разрешить починить колесо Who can patch wheels? @@ -1292,6 +1296,7 @@ Kto może łatać koła? 누가 바퀴를 수리할 수 있습니까? Qui peut rafistoler les roues ? + Кто может починить колеса? Allow Repair @@ -1622,7 +1627,7 @@ Přiřaďte opraváresnké vozidlo Assegna Veicolo Riparazioni Affecter véhicule(s) de réparation - 修理車両として指定 + 修理車両に割り当て 정비 차량 등록 指定维修载具 指定維修載具 @@ -1652,7 +1657,7 @@ Seznam vozidel, která budou klasifikována jako opravárenská, oddělit čárkami. Lista di Veicoli che verranno considerati veicoli riparazioni, separati da virgole. Liste de véhicules qui seront classés comme véhicules de réparation, séparés par des virgules. - 修理車両に指定される車両のリスト。カンマで区切ります。 + 修理車両に割り当てる車両のリスト。カンマで区切ります。 목록내 차량은 정비 차량으로 분류됩니다. 쉼표로 구분합니다. 载具名单,把载具名称输入在这边即可定义其为维修载具。每个载具使用逗号以做区隔。 載具名單,把載具名稱輸入在這邊即可定義其為維修載具。每個載具使用逗號以做區隔。 @@ -1667,7 +1672,7 @@ Opravárenské vozidlo È Veicolo Riparazioni Est un véhicule de réparation - 修理車両にする + 修理車両とする 은 정비 차량이다 是维修载具 是維修載具 @@ -1682,7 +1687,7 @@ Je vozidlo klasifikováno jako opravárenské? Il veicolo è classificato dome veicolo riparazioni? Définit s'il s'agit d'un véhicule de réparation. - 車両を修理車両に指定しますか? + 車両を修理車両として割り当てます 이 차량을 정비 차량으로 분류합니까? 此载具是维修载具吗? 此載具是維修載具嗎? @@ -1712,7 +1717,7 @@ Přiřaďte opravárenské zařízení Assegna Struttura Riparazioni Affecter atelier(s) de réparation - 修理施設とする + 修理施設に割り当て 정비 시설 등록 指定维修设施 指定維修設施 @@ -1742,7 +1747,7 @@ Seznam objektů, které budou klasifikovány jako opravárenské zařízení, oddělit čárkami. Lista di oggetti che verranno classificati come strutture riparazioni, separati da virgole. Liste d'objets qui seront classés comme ateliers de réparation, séparés par des virgules. - 修理施設に指定されるオブジェクトのリスト。カンマで区切ります。 + 修理施設に割り当てるオブジェクトのリスト。カンマで区切ります。 목록내 시설은 정비 시설으로 분류됩니다. 쉼표로 구분합니다. 设施名单,把设施名称输入在这边即可定义其为维修设施。每个设施使用逗号以做区隔。 設施名單,把設施名稱輸入在這邊即可定義其為維修設施。每個設施使用逗號以做區隔。 @@ -1772,7 +1777,7 @@ Je objekt klasifikován jako opravárenské zařízení? L'oggetto è classificato come struttura riparazioni? Définit l'objet comme étant un atelier de réparation. - オブジェクトを修理施設として指定しますか? + オブジェクトを修理施設として割り当てます 이 시설을 정비 시설로 분류합니까? 此设施是维修设施吗? 此設施是維修設施嗎? @@ -1951,6 +1956,7 @@ Wymagania do Łatania Koła 바퀴 수리 아이템 필요 Exigences pour rafistoler une roue + Требования для починки колеса Items required to patch a wheel. @@ -1960,6 +1966,7 @@ Przedmioty wymagane do załatania koła 바퀴를 수리하기 위해 아이템이 필요합니다. Equipements requis pour rafistoler une roue. + Предметы, необходимые для починки колеса. Misc Repair Requirements @@ -2054,7 +2061,7 @@ Number of spare tracks in cargo. Anzahl der Ersatzketten im Laderaum. - カーゴ内の予備履帯の数を指定 + 貨物室内の予備履帯の数を指定 Numero dei cingoli di scorta nel carico. 設定載具在貨艙內攜帶的備用履帶數量 设定载具在货舱内携带的备用履带数量。 @@ -2084,7 +2091,7 @@ Number of spare wheels in cargo. Anzahl der Ersatzreifen im Laderaum. - カーゴ内の予備タイヤの数を指定 + 貨物室内の予備タイヤの数を指定 Numero delle ruote di scorta nel cargo. 設定載具在貨艙內攜帶的備用輪胎數量 设定载具在货舱内携带的备用轮胎数量。 @@ -2134,15 +2141,17 @@ Teilreparaturzeit 부품 수리 시간 Temps de réparation des pièces + Время ремонта детали Time in seconds to complete a repair. - 修理完了までの所要時間 + 修理完了までの所要時間 (秒単位) Czas w sekundach do przeprowadzenia naprawy Tempo in secondi richiesto per completare una riparazione. Zeit in Sekunden, um eine Reparatur abzuschließen. 수리를 완료하는 시간(초 단위) Durée en secondes pour terminer une réparation. + Время завершения ремонта в секундах. Wheel Change Time @@ -2152,15 +2161,17 @@ Radwechselzeit 바퀴 교체 시간 Temps de changement d'une roue + Время замены колеса Time in seconds to remove or change a wheel. - タイヤの取り外しまたは交換に掛かる時間。 + タイヤの取り外しまたは交換に掛かる時間。 (秒単位) Czas w sekundach do zdjęcia lub zmienienia koła. Tempo in secondi richiesto per rimuovere o sostituire una ruota. Zeit in Sekunden, um ein Rad zu entfernen oder zu wechseln. 바퀴를 제거하거나 교체하는 데 걸리는 시간(초 단위) Durée en seconde pour enlever ou changer une roue. + Время в секундах на снятие или замену колеса. Patch Wheel @@ -2170,6 +2181,7 @@ Załataj Koło 바퀴 수리 Rafistoler la roue + Чинить колесо Patching Wheel... @@ -2179,6 +2191,7 @@ Łatanie Koła... 바퀴 수리 중... Rafistolage de la roue... + Починка колеса... Wheel Patch Time @@ -2188,6 +2201,7 @@ Zeit um Räder zu flicken 바퀴 수리 시간 Temps de rafistolage d'une roue + Время починки полеса Time it takes to patch a wheel by 5%. @@ -2197,6 +2211,7 @@ Zeit, die benötigt wird, um ein Rad um 5 % zu flicken. 바퀴를 5% 수리하는 데 걸리는 시간(초 단위) Durée pour rafistoler une roue de 5%. + Время, необходимое для починки колеса, сокращается на 5%. Patch Wheel Threshold @@ -2206,33 +2221,37 @@ Rad flicken Schwellenwert 바퀴 수리 한계점 Seuil de rafistolage d'une roue + Порог починки колеса - Maximum level to which a wheel can be patched. - タイヤを補修できる最大の度合い。 - Maksymalny poziom, do którego koło może zostać załatane. + Maximum damage to which a wheel can be patched.\n0% means all damage can be repaired. + タイヤをのダメージ補修できる最大の度合い。/n 0%は、すべてのダメージが修復可能であることを意味します。 + Maksymalny poziom, do którego koło może zostać załatane.\n0% oznacza że każde uszkodzenia mogą być naprawione. Livello di integrità massimo di una ruota rattoppata. - Maximales Level, bis zu dem ein Rad geflickt werden kann. + Maximales Level, bis zu dem ein Rad geflickt werden kann.\n0% bedeutet, dass das Rad vollständig repariert werden kann. 바퀴를 수리할 수 있는 최대 레벨입니다. - Niveau maximum de rafistolage d'une roue. + Niveau maximum de dégâts jusqu'à laquelle une roue peut être réparée.\n0% signifie que la roue peut être reparée entièrement. + Максимальный уровень, до которого колесо может быть починено. Wheel Patch Location - タイヤ補修場所 + タイヤ補修可能な場所 Miejsce Łatania Koła Luoghi rattoppamento ruote Räder Flick Ort 바퀴 수리 장소 Lieu de rafistolage des roues + Место починки колеса Where the wheel can be patched. - タイヤを補修できる場所。 + タイヤを補修することが出来る場所。 Gdzie można załatać koło. In quali luoghi è possibile rattoppare una ruota? Wo das Rad geflickt werden kann. 바퀴를 수리할 수 있는 곳입니다. Lieu où les roues peuvent être rafistolées. + Где колесо можно починить. On the ground @@ -2242,6 +2261,7 @@ Na ziemi 지면 위 Sur le terrain + На земле On a vehicle @@ -2251,6 +2271,7 @@ Na pojeździe 차량 Sur un véhicule + На транспорте diff --git a/addons/respawn/XEH_postInit.sqf b/addons/respawn/XEH_postInit.sqf index 6c1b1e9961..502f5f729f 100644 --- a/addons/respawn/XEH_postInit.sqf +++ b/addons/respawn/XEH_postInit.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -["ace_rallypointMoved", FUNC(updateRallypoint)] call CBA_fnc_addEventHandler; -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; // hide enemy rallypoint markers +["ace_rallypointMoved", LINKFUNC(updateRallypoint)] call CBA_fnc_addEventHandler; +["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; // hide enemy rallypoint markers -[QGVAR(showFriendlyFireMessageEvent), FUNC(showFriendlyFireMessage)] call CBA_fnc_addEventHandler; +[QGVAR(showFriendlyFireMessageEvent), LINKFUNC(showFriendlyFireMessage)] call CBA_fnc_addEventHandler; diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf index f94e14d644..9514966541 100644 --- a/addons/respawn/functions/fnc_handlePlayerChanged.sqf +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -19,9 +19,9 @@ params ["_newUnit"]; private _side = side group _newUnit; -((GETMVAR(ACE_Rallypoint_West, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); -((GETMVAR(ACE_Rallypoint_West_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); -((GETMVAR(ACE_Rallypoint_East, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); -((GETMVAR(ACE_Rallypoint_East_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); -((GETMVAR(ACE_Rallypoint_Independent, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); -((GETMVAR(ACE_Rallypoint_Independent_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); +((GETMVAR(ACE_Rallypoint_West,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == west)); +((GETMVAR(ACE_Rallypoint_West_Base,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == west)); +((GETMVAR(ACE_Rallypoint_East,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == east)); +((GETMVAR(ACE_Rallypoint_East_Base,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == east)); +((GETMVAR(ACE_Rallypoint_Independent,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == independent)); +((GETMVAR(ACE_Rallypoint_Independent_Base,objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal (parseNumber (_side == independent)); diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index 50931a87f4..7e4651e1e9 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -53,7 +53,7 @@ if (hasInterface) then { private _type = ["selector_selectedFriendly", "selector_selectedEnemy"] select (_respawnMarker == ""); _marker setMarkerTypeLocal _type; - _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init + _marker setMarkerAlphaLocal (parseNumber (_side == playerSide)); // playerSide to guarantee init private _date = _rallypoint getVariable [QGVAR(markerDate), ""]; diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 0af3357201..31ba68f1d6 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -23,7 +23,6 @@ if !(_activated) exitWith {}; { _x setVariable ["ACE_canMoveRallypoint", true]; - false -} count _units; +} forEach _units; INFO("Rallypoint Module Initialized."); diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index e0823fe6e0..afbc7def86 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -17,7 +17,7 @@ */ params ["_unit", "_allGear", "_activeWeaponAndMuzzle"]; -TRACE_3("restoreGear",_unit, count _allGear, _activeWeaponAndMuzzle); +TRACE_3("restoreGear",_unit,count _allGear,_activeWeaponAndMuzzle); // restore all gear if (!isNil "_allGear") then { diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 8ff5ded8ff..6db9f12913 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -382,7 +382,7 @@ Este módulo permite usar puntos de reunión en la misión, a los que pueden teletransportarse las unidades desde la bandera de base. Requiere colocar objetos especiales en el mapa: las banderas de base y de reunión, ambas disponibles en la categoría Vacio-> Reaparición ACE Ce module vous permet d'utiliser des points de ralliement dans les missions, vers lesquels vous pouvez vous téléporter rapidement depuis le drapeau de la base.\nNécessite de placer des objets spéciaux sur la carte - base et drapeau, tous deux disponibles dans la catégorie "Vide -> ACE Réapparition". ミッションでベースから素早く移動できるラリーポイントを使えるようにします。ゲーム内に専用オブジェクトとなるベースとフラッグを設置している必要があります。両オブジェクトは Empty 下の ACE リスポーンから設置できます。 - 이 모듈은 미션 중에 기지 깃발에서 집결지로 빠르게 텔레포트 시켜주는 역할을 합니다. 지도 상에 기지 및 깃발이 필요합니다. 두 가지 모두 Empty->ACE Respawn 카테고리에서 찾을 수 있습니다. + 이 모듈은 미션 중에 기지 깃발에서 집결지로 빠르게 텔레포트 시켜주는 역할을 합니다. 지도 상에 기지 및 깃발이 필요합니다. 두 가지 모두 비어 있음->ACE 재투입 카테고리에서 찾을 수 있습니다. 摆放此模块后,你将能在任务中部署集合点,使你可以快速往返基地与前线。要使用本功能,请记得放上空物体->ACE 重生里面的基地与旗帜。 擺放此模塊後,你將能在任務中佈署集合點,使你可以快速往返基地與前線。要使用本功能,請記得放上空物件->ACE 重生裡面的基地與旗幟 diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 30c4dfd59c..257e5864f6 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -34,7 +34,7 @@ if (_filename == "") exitWith { }; // add file extension .wss as default -if !(toLower (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { +if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { _filename = format ["%1.wss", _filename]; }; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 8afc6802c1..10372f1a2e 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -56,8 +56,7 @@ if (inputAction "nextWeapon" > 0) then { if (_x == "this") then { _modes pushBack _weapon; }; - nil - } count getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); + } forEach getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); // select last mode private _mode = _modes select (count _modes - 1); diff --git a/addons/sandbag/XEH_postInit.sqf b/addons/sandbag/XEH_postInit.sqf index a03f6076a1..24122aed8e 100644 --- a/addons/sandbag/XEH_postInit.sqf +++ b/addons/sandbag/XEH_postInit.sqf @@ -15,11 +15,11 @@ GVAR(deployDirection) = 0; ["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting. -["unit", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; -["loadout", {_this call FUNC(handlePlayerInventoryChanged)}] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["loadout", LINKFUNC(handlePlayerInventoryChanged)] call CBA_fnc_addPlayerEventHandler; ["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle waking up dragged unit and falling unconscious while dragging -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler; //@todo Captivity? diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf index 7c21656ca0..2bcc418f4c 100644 --- a/addons/sandbag/functions/fnc_pickup.sqf +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -34,7 +34,7 @@ _unit setVariable [QGVAR(isUsingSandbag), true]; // Force physx update { _x setPosASL (getPosASL _x); - } count (_unit nearObjects ["ACE_SandbagObject", 5]); + } forEach (_unit nearObjects ["ACE_SandbagObject", 5]); [_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory); }, [_unit, _sandbag], 1.5] call CBA_fnc_waitAndExecute; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 8c221a4651..997fe8d6dd 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -9,6 +9,9 @@ if (!hasInterface) exitWith {}; +// Add keybinds +#include "initKeybinds.inc.sqf" + GVAR(Optics) = ["", "", ""]; GVAR(Guns) = ["", "", ""]; GVAR(canAdjustElevation) = [false, false, false]; @@ -16,15 +19,17 @@ GVAR(canAdjustWindage) = [false, false, false]; GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; ["CBA_settingsInitialized", { - if (!GVAR(enabled)) exitWith {}; - if (GVAR(deduceBarometricPressureFromTerrainAltitude)) then { - GVAR(zeroReferenceBarometricPressure) = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495; + // Overwrite setting if automatic pressure deduction is wanted + if (isServer && GVAR(deduceBarometricPressureFromTerrainAltitude)) then { + private _referencePressure = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495; + + [QGVAR(zeroReferenceBarometricPressure), _referencePressure, 2, "server"] call CBA_settings_fnc_set; }; // Check inventory when it changes - ["loadout", FUNC(inventoryCheck), true] call CBA_fnc_addPlayerEventHandler; + ["loadout", LINKFUNC(inventoryCheck), true] call CBA_fnc_addPlayerEventHandler; // Instantly hide knobs when scoping in ["cameraView", { @@ -41,106 +46,7 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; }; }] call CBA_fnc_addPlayerEventHandler; - // Add keybinds - ["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [201, [false, false, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [209, [false, false, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [209, [false, true, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [201, [false, true, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [201, [true, false, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [209, [true, false, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [209, [true, true, false]], true] call CBA_fnc_addKeybind; - - ["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; - - [ACE_player] call FUNC(inventoryCheck); - - // Statement - [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); - }, {false}, [201, [true, true, false]], true] call CBA_fnc_addKeybind; - - // Register fire event handler - ["ace_firedPlayer", DFUNC(firedEH)] call CBA_fnc_addEventHandler; - ["ace_firedPlayerNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; - + ["ace_firedPlayer", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index bd2d2d1da6..0a9d7bd089 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -17,12 +17,13 @@ * Public: No */ +if (!GVAR(enabled)) exitWith {false}; + params ["_unit", "_turretAndDirection", "_majorStep"]; TRACE_3("adjustScope",_unit,_turretAndDirection,_majorStep); if (!(_unit isKindOf "Man")) exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; -if (!GVAR(enabled)) exitWith {false}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 1a130840ed..44e64b7674 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -if (vehicle _unit != _unit) exitWith {false}; +if (!isNull objectParent _unit) exitWith {false}; private _weaponClass = currentWeapon _unit; private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex); diff --git a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf index 6cb53c3898..ab84db7cde 100644 --- a/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf +++ b/addons/scopes/functions/fnc_calculateZeroAngleCorrection.sqf @@ -4,24 +4,28 @@ * Calculates the zero angle correction for the new zero range based on current zero range and bore height (distance between bore- and sight axis) * * Arguments: - * 0: Zero range - * 1: Bore height - * 2: Weapon - * 3: Ammo - * 4: Magazine - * 5: Advanced Ballistics enabled? + * 0: Old Zero range + * 1: New Zero range + * 2: Bore height + * 3: Weapon + * 4: Ammo + * 5: Magazine + * 6: Advanced Ballistics enabled? * * Return Value: * zeroAngleCorrection * * Example: - * [5, 6, gun, ammo, magazine, true] call ace_scopes_fnc_calculateZeroAngleCorrection + * [5, 6, 7, gun, ammo, magazine, true] call ace_scopes_fnc_calculateZeroAngleCorrection * * Public: No */ params ["_oldZeroRange", "_newZeroRange", "_boreHeight"/*in cm*/, "_weapon", "_ammo", "_magazine", "_advancedBallistics"]; +// When FFV from vehicles currentZeroing will report 0 so just bail +if (_oldZeroRange <= 0) exitWith { 0 }; + private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); private _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); private _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index 58a8807480..ca03ab4123 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -18,7 +18,7 @@ params ["_unit"]; if (cameraView == "GUNNER") exitWith {false}; -if (vehicle _unit != _unit) exitWith {false}; +if (!isNull objectParent _unit) exitWith {false}; if (GVAR(simplifiedZeroing)) exitWith {false}; if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; diff --git a/addons/scopes/functions/fnc_canResetZero.sqf b/addons/scopes/functions/fnc_canResetZero.sqf index cd3f1fb4eb..79dae44be9 100644 --- a/addons/scopes/functions/fnc_canResetZero.sqf +++ b/addons/scopes/functions/fnc_canResetZero.sqf @@ -18,7 +18,7 @@ params ["_unit"]; if (cameraView == "GUNNER") exitWith {false}; -if (vehicle _unit != _unit) exitWith {false}; +if (!isNull objectParent _unit) exitWith {false}; if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 86d9848162..f1b8e91bf4 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (!(_ammo isKindOf "BulletBase")) exitWith {}; diff --git a/addons/scopes/functions/fnc_resetZero.sqf b/addons/scopes/functions/fnc_resetZero.sqf index 76ee6355a8..c22df8bb0f 100644 --- a/addons/scopes/functions/fnc_resetZero.sqf +++ b/addons/scopes/functions/fnc_resetZero.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -if (vehicle _unit != _unit) exitWith {false}; +if (!isNull objectParent _unit) exitWith {false}; private _weaponClass = currentWeapon _unit; private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex); diff --git a/addons/scopes/initKeybinds.inc.sqf b/addons/scopes/initKeybinds.inc.sqf new file mode 100644 index 0000000000..a147b1b215 --- /dev/null +++ b/addons/scopes/initKeybinds.inc.sqf @@ -0,0 +1,95 @@ +["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), LLSTRING(AdjustUpMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [201, [false, false, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), LLSTRING(AdjustDownMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [209, [false, false, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), LLSTRING(AdjustLeftMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [209, [false, true, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), LLSTRING(AdjustRightMinor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [201, [false, true, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), LLSTRING(AdjustUpMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [201, [true, false, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), LLSTRING(AdjustDownMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [209, [true, false, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), LLSTRING(AdjustLeftMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [209, [true, true, false]], true] call CBA_fnc_addKeybind; + +["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), LLSTRING(AdjustRightMajor), { + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + + [ACE_player] call FUNC(inventoryCheck); + + // Statement + [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); +}, {false}, [201, [true, true, false]], true] call CBA_fnc_addKeybind; diff --git a/addons/scopes/initSettings.inc.sqf b/addons/scopes/initSettings.inc.sqf index 917587be8e..40ed62cbcc 100644 --- a/addons/scopes/initSettings.inc.sqf +++ b/addons/scopes/initSettings.inc.sqf @@ -5,7 +5,9 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(enabled_displayName), LSTRING(enabled_description)], _category, true, - 1 + 1, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -69,7 +71,9 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(deduceBarometricPressureFromTerrainAltitude_displayName), LSTRING(deduceBarometricPressureFromTerrainAltitude_description)], _category, false, - 1 + 1, + {[QGVAR(deduceBarometricPressureFromTerrainAltitude), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf index 12adfb9f6c..5495ef0e97 100644 --- a/addons/sitting/XEH_clientInit.sqf +++ b/addons/sitting/XEH_clientInit.sqf @@ -4,13 +4,13 @@ if (!hasInterface) exitWith {}; ["ace_settingsInitialized", { - TRACE_1("SettingInit", XGVAR(enable)); + TRACE_1("SettingInit",XGVAR(enable)); // If not enabled, then do not add CanInteractWith Condition or event handlers if (!XGVAR(enable)) exitWith {}; // Initialize classes as they spawn - ["ThingX", "init", FUNC(addSitActions), nil, nil, true] call CBA_fnc_addClassEventHandler; + ["ThingX", "init", LINKFUNC(addSitActions), nil, nil, true] call CBA_fnc_addClassEventHandler; // Initialize statically defined benches (also appear as world objects, no class EH thrown) { @@ -21,6 +21,6 @@ if (!hasInterface) exitWith {}; ["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(sittingStatus)}}] call EFUNC(common,addCanInteractWithCondition); // Handle interruptions - ["ace_unconscious", {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler; - ["ace_captives_SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler; + ["ace_unconscious", LINKFUNC(handleInterrupt)] call CBA_fnc_addEventHandler; + ["ace_captives_SetHandcuffed", LINKFUNC(handleInterrupt)] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 98ece0c62f..2d7cc999da 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -92,7 +92,7 @@ private _seatDistOrig = (getPosASL _player) distance _seat; // Remove PFH if not sitting any more if (isNil {_player getVariable QGVAR(sittingStatus)}) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; - TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(sittingStatus), false)]); + TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(sittingStatus),false)]); }; // Stand up if chair gets deleted or moved diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index 8ec804d577..409c724943 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -34,7 +34,7 @@ private _actions = []; (_this select 2) params ["_objects", "_image", "_currentSlideshow", "_selection"]; { _x setObjectTextureGlobal [_selection, _image] - } count _objects; + } forEach _objects; [QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent; }, {true}, diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index 793b8baf1b..6a18a041c4 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -36,7 +36,7 @@ private _image = _images select _currentSlide; // Set slide { _x setObjectTextureGlobal [_selection, _image]; -} count _objects; +} forEach _objects; [QGVAR(slideChanged), [_image, _currentSlideshow]] call CBA_fnc_localEvent; diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 87fd40bbbe..c24d302346 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -50,7 +50,7 @@ if (isServer) then { // Default images on whiteboards (first image) { _x setObjectTextureGlobal [_selection, _images select 0]; - } count _objects; + } forEach _objects; }; // Number of slideshows (multiple modules support) @@ -61,7 +61,7 @@ private _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR get // If interaction menu module is not present, set default duration value if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { _duration = NOINTERACTMENU_DURATION; - INFO_1("Interaction Menu module not present, defaulting duration value to %1",_duration); + INFO_1("Interaction Menu module not present,defaulting duration value to %1",_duration); }; // Add interactions if automatic transitions are disabled, else setup automatic transitions @@ -89,8 +89,7 @@ if (_duration == 0) then { 2 ] call EFUNC(interact_menu,createAction); [_x, 0, ["ACE_MainActions"], _slidesAction] call EFUNC(interact_menu,addActionToObject); - nil - } count _controllers; + } forEach _controllers; } else { if !(isServer) exitWith {}; diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index 896c64eb50..7e6a78dc95 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -37,8 +37,7 @@ private _selection = _logic getVariable ["Selection", 0]; // Objects synced to the module { _objects pushBack _x; - nil -} count (synchronizedObjects _logic); +} forEach (synchronizedObjects _logic); // Prepare with actions [_objects, _controllers, _images, _names, _duration, _setName, _selection] call FUNC(createSlideshow); diff --git a/addons/smallarms/CfgWeapons.hpp b/addons/smallarms/CfgWeapons.hpp index 1e4be69369..7b569d4292 100644 --- a/addons/smallarms/CfgWeapons.hpp +++ b/addons/smallarms/CfgWeapons.hpp @@ -191,6 +191,9 @@ class CfgWeapons { class LMG_03_F: LMG_03_Base_F { magazineReloadTime = 0; // Fix for reloading every time weapon is equipped }; + class LMG_03_Vehicle_F: LMG_03_F { + magazineReloadTime = 5.8; // Should be same as LMG_03_Base_F + }; // Sniper and anti-materiel rifles ///////////////////////////////// diff --git a/addons/spectator/functions/fnc_compat_spectatorBI.sqf b/addons/spectator/functions/fnc_compat_spectatorBI.sqf index 3d982830a0..9bf39ec256 100644 --- a/addons/spectator/functions/fnc_compat_spectatorBI.sqf +++ b/addons/spectator/functions/fnc_compat_spectatorBI.sqf @@ -18,7 +18,7 @@ */ private _respawn = getMissionConfigValue ["respawn",0]; -if (_respawn isEqualType "") then { _respawn = ["","bird","","","group","side"] find (toLower _respawn); }; +if (_respawn isEqualType "") then { _respawn = ["","bird","","","group","side"] find (toLowerANSI _respawn); }; if !(_respawn in [1,4,5]) exitWith {}; // Remember to check for side specific templates diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index 4bd6817591..7f55998d9f 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -224,7 +224,7 @@ Maximum distance the follow camera can be from the target Maximale Distanz in welcher die Kamera dem Ziel folgen kann. Максимальная дистанция от камеры слежения до цели - カメラが目標へ追随できる最大距離を決定できます。 + カメラが目標へ追随できる最大距離 A distância máxima que a câmera de acompanhamento pode estar do alvo. 攝影機能追隨目標的最大距離 摄影机能追随目标的最大距离 diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index 6be6d70d63..93fa00a7bc 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -48,7 +48,7 @@ class CfgVehicles { selection = ""; displayName = CSTRING(PickUp); distance = 5; - condition = QUOTE((alive _target) && (count (crew _target) == 0)); + condition = QUOTE((alive _target) && {(crew _target) isEqualTo []}); statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); showDisabled = 0; exceptions[] = {}; diff --git a/addons/switchunits/functions/fnc_isValidAi.sqf b/addons/switchunits/functions/fnc_isValidAi.sqf index e78e990924..53ebcdaac2 100644 --- a/addons/switchunits/functions/fnc_isValidAi.sqf +++ b/addons/switchunits/functions/fnc_isValidAi.sqf @@ -19,6 +19,6 @@ params ["_unit"]; !([_unit] call EFUNC(common,isPlayer) || {_unit in playableUnits} -|| {vehicle _unit != _unit} +|| {!isNull objectParent _unit} || {_unit getVariable [QGVAR(IsPlayerUnit), false]} || {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return diff --git a/addons/switchunits/functions/fnc_markAiOnMap.sqf b/addons/switchunits/functions/fnc_markAiOnMap.sqf index 8c7dc4924c..203ba426ff 100644 --- a/addons/switchunits/functions/fnc_markAiOnMap.sqf +++ b/addons/switchunits/functions/fnc_markAiOnMap.sqf @@ -27,7 +27,7 @@ GVAR(AllMarkerNames) = []; // delete markers { deleteMarkerLocal _x; - } count GVAR(AllMarkerNames); + } forEach GVAR(AllMarkerNames); // reset the array GVAR(AllMarkerNames) = []; @@ -58,8 +58,7 @@ GVAR(AllMarkerNames) = []; }; GVAR(AllMarkerNames) pushBack _markerName; - nil }; - } count allUnits; + } forEach allUnits; }; }, 1.5, [_sidesToShow]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index 6fc8fa35c9..135088d243 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -27,7 +27,7 @@ if (GVAR(EnableSafeZone)) then { private _allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers); private _nearestEnemyPlayers = _allNearestPlayers select {((side GVAR(OriginalGroup)) getFriend side _x < 0.6) && !(_x getVariable [QGVAR(IsPlayerControlled), false])}; - if (count _nearestEnemyPlayers > 0) exitWith { + if (_nearestEnemyPlayers isNotEqualTo []) exitWith { _leave = true; }; }; diff --git a/addons/tacticalladder/XEH_postInit.sqf b/addons/tacticalladder/XEH_postInit.sqf index 1a6f356fb0..c4b25a77ab 100644 --- a/addons/tacticalladder/XEH_postInit.sqf +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -17,10 +17,10 @@ GVAR(currentAngle) = 0; ["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel adjusting on player change. -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; ["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle falling unconscious -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler; // @todo captivity? diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index 85804e091f..0f399536f4 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -23,7 +23,7 @@ removeBackpack _unit; private _pos = _unit modelToWorld [0,0,0]; -private _offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; +private _offset = [0.8, 1] select (_unit call CBA_fnc_getUnitAnim select 0 == "prone"); _pos set [0, (_pos select 0) + (sin getDir _unit) * _offset]; _pos set [1, (_pos select 1) + (cos getDir _unit) * _offset]; diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 1ea19e737b..6d6f78f1a3 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -26,7 +26,7 @@ params ["_unit", "_ladder"]; { _ladder animate [_x, 0]; -} count __ANIMS; +} forEach __ANIMS; [_unit, "amovpercmstpslowwrfldnon_player_idlesteady03", 2] call EFUNC(common,doAnimation); @@ -35,7 +35,7 @@ _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of playe _ladder animate ["rotate", 0]; { _ladder animate [_x, 1]; -} count ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) +} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) GVAR(ladder) = _ladder; GVAR(cancelTime) = CBA_missionTime + 1; // Workaround to prevent accidental canceling diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index 7fefa5757e..dd46b7fb98 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -14,7 +14,7 @@ if (hasInterface) then { call FUNC(compileConfigTags); // Scripted tag adding EH - [QGVAR(applyCustomTag), FUNC(applyCustomTag)] call CBA_fnc_addEventHandler; + [QGVAR(applyCustomTag), LINKFUNC(applyCustomTag)] call CBA_fnc_addEventHandler; // Keybind ["ACE3 Equipment", QGVAR(quickTag), localize LSTRING(QuickTag), { @@ -32,4 +32,4 @@ if (!isServer) exitWith {}; GVAR(testingThread) = false; GVAR(tagsToTest) = []; -[QGVAR(createTag), DFUNC(createTag)] call CBA_fnc_addEventHandler; +[QGVAR(createTag), LINKFUNC(createTag)] call CBA_fnc_addEventHandler; diff --git a/addons/tagging/XEH_preStart.sqf b/addons/tagging/XEH_preStart.sqf index 9303bdb135..e1ac396c48 100644 --- a/addons/tagging/XEH_preStart.sqf +++ b/addons/tagging/XEH_preStart.sqf @@ -12,7 +12,7 @@ private _vehicleClasses = "(configName _x) isKindOf 'Static'" configClasses (con private _model = getText (_x >> "model"); if (_model != "") then { private _array = _model splitString "\"; - _cacheStaticModels pushBackUnique toLower (_array select ((count _array) - 1)); + _cacheStaticModels pushBackUnique toLowerANSI (_array select -1); }; } forEach _vehicleClasses; @@ -24,7 +24,7 @@ private _cfgBase = configFile >> "CfgNonAIVehicles"; private _model = getText (_x >> "model"); if (_model != "") then { private _array = _model splitString "\"; - _cacheStaticModels pushBackUnique toLower (_array select ((count _array) - 1)); + _cacheStaticModels pushBackUnique toLowerANSI (_array select -1); }; } forEach (_nonaivehicleClasses select {(configName _x) isKindOf ["Bridge_base_F", _cfgBase]}); diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index 4e4310a0cf..aa0ba9fac9 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -45,7 +45,7 @@ if (_intersections isEqualTo []) exitWith { }; (_intersections select 0) params ["_touchingPoint", "_surfaceNormal", "", "_object"]; -TRACE_3("",_touchingPoint, _surfaceNormal, _object); +TRACE_3("",_touchingPoint,_surfaceNormal,_object); // Exit if trying to tag a non static object if ((!isNull _object) && { @@ -93,7 +93,7 @@ private _vectorDirAndUp = if (abs (_v1 select 2) < 0.94) then { [_v1, _v3] }; -TRACE_3("Reference:", _v1, _v2, _v3); +TRACE_3("Reference:",_v1,_v2,_v3); private _fnc_isOk = { params ["_rx", "_ry"]; diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index d64fb5ef95..4d32fac6d6 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -274,7 +274,7 @@ Černý sprej Spray de tinta preta Черный спрей - ペイントスプレー缶 (黒色) + スプレーペイント缶 (黒色) 검정 스프레이 黑色喷漆 黑色噴漆 @@ -290,7 +290,7 @@ Červený sprej Spray de tinta vermelha Красный спрей - ペイントスプレー缶 (赤色) + スプレーペイント缶 (赤色) 빨강 스프레이 红色喷漆 紅色噴漆 @@ -306,7 +306,7 @@ Zelený sprej Spray de tinta verde Зелёный спрей - ペイントスプレー缶 (緑色) + スプレーペイント缶 (緑色) 초록 스프레이 绿色喷漆 綠色噴漆 @@ -322,7 +322,7 @@ Modrý sprej Spray de tinta azul Синий спрей - ペイントスプレー缶 (青色) + スプレーペイント缶 (青色) 파랑 스프레이 蓝色喷漆 藍色噴漆 @@ -338,7 +338,7 @@ Žlutý sprej Spray de tinta amarela Желтый спрей - ペイントスプレー缶 (黄色) + スプレーペイント缶 (黄色) 노랑 스프레이 黄色喷漆 黃色噴漆 @@ -354,7 +354,7 @@ Bílý sprej Spray de tinta branca Белый спрей - ペイントスプレー缶 (白色) + スプレーペイント缶 (白色) 하양 스프레이 白色喷漆 白色噴漆 @@ -370,7 +370,7 @@ Plechovka se sprejem k vytváření značek. Uma lata de tinta spray para marcar paredes. Балончик спрея для рисования маркеров на стенах. - 壁にタグを描くためのペイントスプレー缶。 + 壁にタグを描くためのスプレーペイント缶。 벽에 낙서할 수 있는 스프레이캔 입니다. 喷漆可喷涂在墙壁上 噴漆可噴塗在牆壁上 @@ -383,6 +383,7 @@ Marcatore identificativo sui veicoli 차량 ID 마킹 Marquage ID des véhicules + Идентификационная маркировка транспортного средства Replaces clan tag with stenciled text @@ -392,6 +393,7 @@ Sostituisce l'icona del clan con testo in stampatello 클랜 태그를 스텐실 텍스트로 바꿉니다. Remplace le tag du clan par un texte au pochoir + Заменяет тег клана трафаретным текстом diff --git a/addons/towing/CfgVehicles.hpp b/addons/towing/CfgVehicles.hpp index df791d95d3..6775a8c9e2 100644 --- a/addons/towing/CfgVehicles.hpp +++ b/addons/towing/CfgVehicles.hpp @@ -1,84 +1,61 @@ -#define TOW_ACTION \ -class ACE_Actions {\ - class ACE_MainActions {\ - class ADDON {\ - displayName = CSTRING(displayName);\ - distance = TOW_ACTION_DISTANCE;\ - condition = QUOTE([ARR_1(_target)] call FUNC(isSuitableSimulation));\ - statement = "";\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - showDisabled = 0;\ - icon = "";\ - class GVAR(startTow3) {\ - displayName = CSTRING(start3);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope3')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope3')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow6) {\ - displayName = CSTRING(start6);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope6')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope6')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow12) {\ - displayName = CSTRING(start12);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope12')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope12')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow15) {\ - displayName = CSTRING(start15);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope15')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope15')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow18) {\ - displayName = CSTRING(start18);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope18')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope18')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow27) {\ - displayName = CSTRING(start27);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope27')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope27')] call FUNC(startTow));\ - exceptions[] = { INTERACTION_EXCEPTIONS };\ - };\ - class GVAR(startTow36) {\ - displayName = CSTRING(start36);\ - condition = QUOTE(([ARR_2(_player,_target)] call FUNC(canStartTow)) && [ARR_2(_player,'ACE_rope36')] call EFUNC(common,hasItem));\ - statement = QUOTE([ARR_3(_player,_target,'ACE_rope36')] call FUNC(startTow));\ +#define CONCAT(a,b) a##b +#define TOW_ACTION(length) \ + class GVAR(CONCAT(startTow,length)) {\ + displayName = CSTRING(CONCAT(start,length));\ + condition = QUOTE([ARR_2(_player,'CONCAT(ACE_rope,length)')] call DEFUNC(common,hasItem));\ + statement = QUOTE([ARR_3(_player,_target,'CONCAT(ACE_rope,length)')] call DFUNC(startTow));\ + exceptions[] = { INTERACTION_EXCEPTIONS };\ + } +#define TOW_ACTIONS \ + class ACE_Actions {\ + class ACE_MainActions {\ + class ADDON {\ + displayName = CSTRING(displayName);\ + distance = TOW_ACTION_DISTANCE;\ + condition = QUOTE(alive _target && {_target call DFUNC(isSuitableSimulation)});\ exceptions[] = { INTERACTION_EXCEPTIONS };\ + insertChildren = QUOTE(_target call DFUNC(getDetachActions));\ + TOW_ACTION(3);\ + TOW_ACTION(6);\ + TOW_ACTION(12);\ + TOW_ACTION(15);\ + TOW_ACTION(18);\ + TOW_ACTION(27);\ + TOW_ACTION(36);\ };\ };\ - };\ -} + } class CfgVehicles { class LandVehicle; class Car: LandVehicle { - TOW_ACTION; + TOW_ACTIONS; }; class Tank: LandVehicle { - TOW_ACTION; + TOW_ACTIONS; + }; + + class Ship; + class Ship_F: Ship { + TOW_ACTIONS; }; class ThingX; - class GVAR(hook): ThingX { - displayName = "hook"; // not publicly visible, no stringtable needed + class GVAR(helper): ThingX { + displayName = "helper"; // not publicly visible, no stringtable needed scope = 1; scopeCurator = 1; - model = "\a3\Structures_F_Orange\VR\Helpers\Sign_sphere10cm_Geometry_F.p3d"; + model = "\A3\Weapons_f\empty"; destrType = "DestructNo"; - + }; + class GVAR(hook): GVAR(helper) { + displayName = "hook"; class ACE_Actions { class ACE_MainActions { displayName = CSTRING(detach); - condition = "true"; - statement = QUOTE(private _parent = _target getVariable [ARR_2(QQGVAR(parent),objNull)]; private _child = _target getVariable [ARR_2(QQGVAR(child),objNull)]; [ARR_3(_player,_parent,_child)] call FUNC(detach)); - distance = 2; + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(detachRope)); + distance = TOW_ACTION_DISTANCE; }; }; }; diff --git a/addons/towing/XEH_PREP.hpp b/addons/towing/XEH_PREP.hpp index d26b29e5f0..b72f70c55b 100644 --- a/addons/towing/XEH_PREP.hpp +++ b/addons/towing/XEH_PREP.hpp @@ -1,7 +1,9 @@ PREP(addRopeToVehicle); PREP(attachRopePFH); -PREP(canStartTow); -PREP(detach); +PREP(attachVehicles); +PREP(detachChild); +PREP(detachRope); +PREP(getDetachActions); PREP(isSuitableSimulation); PREP(onMouseButtonDown); PREP(onMouseButtonUp); diff --git a/addons/towing/XEH_postInit.sqf b/addons/towing/XEH_postInit.sqf index 187af19244..01c7d6e48e 100644 --- a/addons/towing/XEH_postInit.sqf +++ b/addons/towing/XEH_postInit.sqf @@ -1,14 +1,40 @@ #include "script_component.hpp" -["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler; + ["MouseButtonUp", LINKFUNC(onMouseButtonUp)] call CBA_fnc_addDisplayHandler; GVAR(mouseLeft) = false; GVAR(mouseRight) = false; GVAR(blockFireEHID) = -1; -GVAR(cancel) = false; -GVAR(canAttach) = false; - -[QGVAR(setTowParent), { - params ["_parent", "_child"]; - _child setTowParent _parent; +[QGVAR(ropeAttachTo), { + params ["_child", "_relativeAttachPos", "_rope", "_helper"]; + TRACE_4("ropeAttachTo",_child,_relativeAttachPos,_rope,_helper); + _helper ropeDetach _rope; + [_child, _relativeAttachPos] ropeAttachTo _rope; + deleteVehicle _helper; }] call CBA_fnc_addEventHandler; + +[QGVAR(attachVehicles), LINKFUNC(attachVehicles)] call CBA_fnc_addEventHandler; +[QGVAR(detachChild), LINKFUNC(detachChild)] call CBA_fnc_addEventHandler; + +if (!isServer) exitWith {}; + +[QGVAR(cleanupParent), { + params ["_parent"]; + TRACE_1("cleanupParent",_parent); + _parent removeEventHandler ["RopeBreak", _parent getVariable [QGVAR(RopeBreakEHID), -1]]; + _parent setVariable [QGVAR(RopeBreakEHID), -1]; + private _parentParentHooks = _parent getVariable [QGVAR(parentHooks), []]; + if (_parentParentHooks isEqualTo []) then { + TRACE_1("remove Deleted EH",_parent); + _parent removeEventHandler ["Deleted", _parent getVariable [QGVAR(DeletedEHID), -1]]; + _parent setVariable [QGVAR(DeletedEHID), -1]; + }; +}] call CBA_fnc_addEventHandler; + +addMissionEventHandler ["PlayerConnected", { + if (GVAR(allChildren) isEqualTo []) exitWith {}; + params ["", "", "", "_jip", "_owner"]; + if (!_jip) exitWith {}; + TRACE_2("pushing children",_owner,GVAR(allChildren)); + [QGVAR(setTowParentAllChildren), [GVAR(allChildren)], _owner] call CBA_fnc_ownerEvent; +}]; diff --git a/addons/towing/XEH_preInit.sqf b/addons/towing/XEH_preInit.sqf index 894773534a..6a85ba442f 100644 --- a/addons/towing/XEH_preInit.sqf +++ b/addons/towing/XEH_preInit.sqf @@ -8,4 +8,20 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" +// handle JIP +if (isServer) then { + GVAR(allChildren) = []; +} else { + // can't use CBA EH in postInit because too late for server PlayerConnected EH + [QGVAR(setTowParentAllChildren), { + params ["_children"]; + TRACE_1("setTowParentAllChildren",_children); + { + private _parent = _x getVariable QGVAR(parent); + TRACE_2("setTowParent",_x,_parent); + _x setTowParent _parent; + } forEach _children; + }] call CBA_fnc_addEventHandler; +}; + ADDON = true; diff --git a/addons/towing/functions/fnc_addRopeToVehicle.sqf b/addons/towing/functions/fnc_addRopeToVehicle.sqf index 4ff0fce62d..9dec1257d0 100644 --- a/addons/towing/functions/fnc_addRopeToVehicle.sqf +++ b/addons/towing/functions/fnc_addRopeToVehicle.sqf @@ -20,8 +20,8 @@ params ["_vehicle"]; if (0 == getNumber (configOf _vehicle >> QEGVAR(cargo,hasCargo))) exitWith {}; -private _ropeType = if ( +private _ropeType = ["ACE_rope6", "ACE_rope12"] select ( -1 < ["Tank", "Wheeled_APC_F", "Truck_F"] findIf {_vehicle isKindOf _x} -) then {"ACE_rope12"} else {"ACE_rope6"}; +); _vehicle addItemCargoGlobal [_ropeType, 1]; diff --git a/addons/towing/functions/fnc_attachRopePFH.sqf b/addons/towing/functions/fnc_attachRopePFH.sqf index e8336ecc25..37f626e0a9 100644 --- a/addons/towing/functions/fnc_attachRopePFH.sqf +++ b/addons/towing/functions/fnc_attachRopePFH.sqf @@ -40,13 +40,32 @@ if (_intersections isNotEqualTo []) then { _intersectionToUse params ["_intersectPosition", "", "_intersectObject"]; - // if we have a target object, we assume we are attaching to the parent. If no target object, we are attaching to child - GVAR(canAttach) = (_intersectObject isNotEqualTo _ignoreParent) && { (!isNull _target && { _intersectObject isEqualTo _target }) || { isNull _target && { [_intersectObject] call FUNC(isSuitableSimulation) }}} && { !(_intersectObject getVariable [QGVAR(towing), false]) }; + GVAR(canAttach) = + _intersectObject isNotEqualTo _ignoreParent + && { + // if we have a target object, we assume we are attaching to the parent. If no target object, we are attaching to child + if (!isNull _target) then { + _intersectObject isEqualTo _target + } else { + [_intersectObject] call FUNC(isSuitableSimulation) + && { // ignore _intersectObject which has parent != _ignoreParent + private _intersectObjectParent = _intersectObject getVariable [QGVAR(parent), objNull]; + isNull _intersectObjectParent || {_intersectObjectParent == _ignoreParent} + } && { // arma prevents making rings (ropeAttachTo silently fails) + private _ancestor = _ignoreParent getVariable [QGVAR(parent), objNull]; + while {!isNull _ancestor && {_ancestor != _intersectObject}} do { + _ancestor = _ancestor getVariable [QGVAR(parent), objNull]; + }; + isNull _ancestor + } + } + } + ; if (GVAR(canAttach)) then { - TRACE_4("can attach",_target,_intersectObject,_ignoreParent,_ignoreRope); + // TRACE_4("can attach",_target,_intersectObject,_ignoreParent,_ignoreRope); GVAR(attachHelper) setPosASL _intersectPosition; - _hintLMB = localize LSTRING(attach); + _hintLMB = LLSTRING(attach); GVAR(attachHelper) setVariable [QGVAR(object), _intersectObject]; }; @@ -76,4 +95,3 @@ if (_hint isNotEqualTo (_unit getVariable [QGVAR(hint), []])) then { _unit setVariable [QGVAR(hint), _hint]; _hint call EFUNC(interaction,showMouseHint); }; - diff --git a/addons/towing/functions/fnc_attachVehicles.sqf b/addons/towing/functions/fnc_attachVehicles.sqf new file mode 100644 index 0000000000..9fd95f3742 --- /dev/null +++ b/addons/towing/functions/fnc_attachVehicles.sqf @@ -0,0 +1,65 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Attaches child to parent vehicle. + * Run globally. + * + * Arguments: + * 0: Vehicle to tow from + * 1: Vehicle to tow + * 2: Rope End Position + * 3: Rope + * 4: Attached Helper Object + * + * Return Value: + * None + * + * Example: + * [parent, cursorObject, [0,0,0], ropes parent select 0] call ace_towing_fnc_attachVehicles + * + * Public: No + */ +params ["_parent", "_child", "_relativeAttachPos", "_rope", "_helper"]; +TRACE_5("attachVehicles",_parent,_child,_relativeAttachPos,_rope,_helper); + +if (local _parent) then { + _helper ropeDetach _rope; + [_child, _relativeAttachPos] ropeAttachTo _rope; + deleteVehicle _helper; +}; + +_child setTowParent _parent; +if (!isServer) exitWith {}; + +_child setVariable [QGVAR(parent), _parent, true]; +GVAR(allChildren) pushBack _child; + +{ + if (-1 == _x getVariable [QGVAR(DeletedEHID), -1]) then { + _x setVariable [QGVAR(DeletedEHID), _x addEventHandler ["Deleted", { + params ["_entity"]; + private _childHooks = _entity getVariable [QGVAR(childHooks), []]; + private _parentHooks = _entity getVariable [QGVAR(parentHooks), []]; + TRACE_3("Deleted EH",_entity,_childHooks,_parentHooks); + { + [objNull, _x, _entity] call FUNC(detachRope); + } forEach (_childHooks + _parentHooks); + if (_childHooks isNotEqualTo []) then { // only for parent + // because deleting lasts for several frames we have to delete RB EH to fix double cleanup + _entity removeEventHandler ["RopeBreak", _entity getVariable QGVAR(RopeBreakEHID)]; + }; + }]]; + }; +} forEach [_parent, _child]; + +if (-1 == _parent getVariable [QGVAR(RopeBreakEHID), -1]) then { + _parent setVariable [QGVAR(RopeBreakEHID), _parent addEventHandler ["RopeBreak", { + params ["_parent", "_rope", "_child"]; + if (isNull _rope) exitWith {}; // happens + private _hook = _rope getVariable [QGVAR(hook), objNull]; + private _hookChild = _hook getVariable [QGVAR(vars), []] param [1, objNull]; + if (isNull _hook || {_child != _hookChild}) exitWith {}; // handle helper detach + TRACE_4("RopeBreak EH",_parent,_rope,_child,_hook); + [objNull, _hook] call FUNC(detachRope); + }]]; +}; diff --git a/addons/towing/functions/fnc_canStartTow.sqf b/addons/towing/functions/fnc_canStartTow.sqf deleted file mode 100644 index 1ffca3df86..0000000000 --- a/addons/towing/functions/fnc_canStartTow.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Condition for whether or not we can tow from this object - * - * Arguments: - * 0: Unit wanting to start towing - * 1: Vehicle to tow from - * - * Return Value: - * Whether or not we can start towing - * - * Example: - * [player, cursorObject] call ace_towing_fnc_canStartTow - * - * Public: No - */ -params ["_unit", "_target"]; -private _isTowing = _target getVariable [QGVAR(towing), false]; -TRACE_1("is towing",_isTowing); -!_isTowing diff --git a/addons/towing/functions/fnc_detach.sqf b/addons/towing/functions/fnc_detach.sqf deleted file mode 100644 index 92494eae0e..0000000000 --- a/addons/towing/functions/fnc_detach.sqf +++ /dev/null @@ -1,48 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Detaches child from parent, and gives rope item back - * - * Arguments: - * 0: Parent - * 1: Child - * - * Return Value: - * None - * - * Example: - * [player, cursorObject] call ace_towing_fnc_detach - * - * Public: No - */ -params ["_unit", "_parent", "_child"]; -TRACE_3("detach",_unit,_parent,_child); - -private _hook = _child getVariable [QGVAR(hook), objNull]; - -_parent removeEventHandler ["Deleted", _hook getVariable QGVAR(parentDeleteEventHandler)]; -_hook setVariable [QGVAR(parentDeleteEventHandler), -1]; - -_child removeEventHandler ["Deleted", _hook getVariable QGVAR(childDeleteEventHandler)]; -_hook setVariable [QGVAR(childDeleteEventHandler), -1]; - -_parent removeEventHandler ["RopeBreak", _parent getVariable QGVAR(ropeBreakEventHandler)]; -_parent setVariable [QGVAR(ropeBreakEventHandler), -1]; - -private _rope = _child getVariable [QGVAR(rope), objNull]; -ropeDestroy _rope; - -private _ropeClass = _hook getVariable [QGVAR(ropeClass), ""]; -deleteVehicle _hook; - -TRACE_1("rope",_ropeClass); - -if (_ropeClass isNotEqualTo "") then { - [_unit, _ropeClass, true] call CBA_fnc_addItem; -}; - -[QGVAR(setTowParent), [objNull, _child], _child] call CBA_fnc_targetEvent; - -_child setVariable [QGVAR(towing), false, true]; -_parent setVariable [QGVAR(towing), false, true]; - diff --git a/addons/towing/functions/fnc_detachChild.sqf b/addons/towing/functions/fnc_detachChild.sqf new file mode 100644 index 0000000000..a30f90d8c6 --- /dev/null +++ b/addons/towing/functions/fnc_detachChild.sqf @@ -0,0 +1,33 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Detaches child. + * Run globally. + * + * Arguments: + * 0: Child + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_towing_fnc_detachChild + * + * Public: No + */ +params ["_child"]; +TRACE_1("detachChild",_child); + +_child setTowParent objNull; + +if (!isServer) exitWith {}; + +_child setVariable [QGVAR(parent), objNull, true]; +GVAR(allChildren) = GVAR(allChildren) - [_child]; + +private _childChildHooks = _child getVariable [QGVAR(childHooks), []]; +if (_childChildHooks isEqualTo []) then { + TRACE_1("remove Deleted EH",_child); + _child removeEventHandler ["Deleted", _child getVariable [QGVAR(DeletedEHID), -1]]; + _child setVariable [QGVAR(DeletedEHID), -1]; +}; diff --git a/addons/towing/functions/fnc_detachRope.sqf b/addons/towing/functions/fnc_detachRope.sqf new file mode 100644 index 0000000000..8baed5532d --- /dev/null +++ b/addons/towing/functions/fnc_detachRope.sqf @@ -0,0 +1,60 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Detaches rope of given hook and gives rope item back. + * + * Arguments: + * 0: Player + * 1: Rope Hook + * 2: Deleted object (default: objNull) + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_towing_fnc_detachRope + * + * Public: No + */ +params ["_unit", "_hook", ["_deletedObject", objNull]]; + +private _hookVars = _hook getVariable QGVAR(vars); +if (isNil "_hookVars") then { // this is hookParent + _hook = _hook getVariable QGVAR(hook); + _hookVars = _hook getVariable QGVAR(vars); +}; + +_hookVars params ["_parent", "_child", "_rope", "_ropeClass", "_hookParent"]; + +TRACE_8("detachRope",_unit,_parent,_child,_hook,_hookParent,_rope,_ropeClass,_deletedObject); + +ropeDestroy _rope; // can run on client + +if (!isNull _unit && {_ropeClass isNotEqualTo ""}) then { + [_unit, _ropeClass, true] call CBA_fnc_addItem; +}; + +{ + detach _x; + deleteVehicle _x; +} forEach [_hook, _hookParent]; + +// cleanup object variables and EHs only if function isn't called from Deleted EH +if (isNull _deletedObject || {_parent isNotEqualTo _deletedObject}) then { + private _parentChildHooks = _parent getVariable [QGVAR(childHooks), []]; + _parentChildHooks = _parentChildHooks - [_hook]; + _parent setVariable [QGVAR(childHooks), _parentChildHooks, true]; + + if (_parentChildHooks isEqualTo []) then { + [QGVAR(cleanupParent), _parent] call CBA_fnc_serverEvent; + }; +}; +if (isNull _deletedObject || {_child isNotEqualTo _deletedObject}) then { + private _childParentHooks = _child getVariable [QGVAR(parentHooks), []]; + _childParentHooks = _childParentHooks - [_hook]; + _child setVariable [QGVAR(parentHooks), _childParentHooks, true]; + + if (_childParentHooks isEqualTo []) then { + [QGVAR(detachChild), _child] call CBA_fnc_globalEvent; + }; +}; diff --git a/addons/towing/functions/fnc_getDetachActions.sqf b/addons/towing/functions/fnc_getDetachActions.sqf new file mode 100644 index 0000000000..4f86220797 --- /dev/null +++ b/addons/towing/functions/fnc_getDetachActions.sqf @@ -0,0 +1,40 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Creates vehicle detach actions for attached ropes. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * Detach actions + * + * Example: + * cursorObject call ace_towing_fnc_getDetachActions + * + * Public: No + */ +params ["_vehicle"]; + +private _statement = { + params ["", "_player", "_hook"]; + [_player, _hook] call FUNC(detachRope); +}; + +private _parentHooks = _vehicle getVariable [QGVAR(parentHooks), []]; +private _childHooks = _vehicle getVariable [QGVAR(childHooks), []]; + +(_parentHooks + _childHooks) apply { + private _hook = _x; + _hook getVariable QGVAR(vars) params ["_hookParent", "_hookChild"]; + private _partner = [_hookParent, _hookChild] select (_vehicle == _hookParent); + private _partnerName = getText (configOf _partner >> "displayName"); + private _partnerOwnerName = [_partner, true] call EFUNC(common,getName); + if (_partnerOwnerName != "") then { + _partnerName = format ["%1, %2", _partnerName, _partnerOwnerName]; + }; + private _name = format ["%1 (%2)", LLSTRING(detach), _partnerName]; + private _icon = [_partner] call EFUNC(common,getVehicleIcon); + private _action = [format ["%1", _hook], _name, _icon, _statement, {true}, {}, _hook] call EFUNC(interact_menu,createAction); + [_action, [], _vehicle] +} diff --git a/addons/towing/functions/fnc_isSuitableSimulation.sqf b/addons/towing/functions/fnc_isSuitableSimulation.sqf index c808dc20c4..a4131e6a91 100644 --- a/addons/towing/functions/fnc_isSuitableSimulation.sqf +++ b/addons/towing/functions/fnc_isSuitableSimulation.sqf @@ -19,8 +19,7 @@ params ["_target"]; // need toLower since apparently this isn't case sensitive private _simulationType = getText ((configOf _target) >> "simulation"); -TRACE_1("sim type",_simulationType); +// TRACE_1("sim type",_simulationType); // Biki lies, you can both tow and tow as either TankX or CarX -(toLower _simulationType) in ["tankx", "carx"] - +(toLowerANSI _simulationType) in ["tankx", "carx", "shipx"] diff --git a/addons/towing/functions/fnc_startTow.sqf b/addons/towing/functions/fnc_startTow.sqf index fa70d91cff..33cee1cb7b 100644 --- a/addons/towing/functions/fnc_startTow.sqf +++ b/addons/towing/functions/fnc_startTow.sqf @@ -32,5 +32,6 @@ GVAR(isSwimming) = _unit call EFUNC(common,isSwimming); GVAR(putWeaponAwayNextFrame) = false; GVAR(cancel) = false; GVAR(canAttach) = false; +GVAR(onMouseButtonDownEHID) = ["MouseButtonDown", LINKFUNC(onMouseButtonDown)] call CBA_fnc_addDisplayHandler; [LINKFUNC(towStateMachinePFH), 0, [TOW_STATE_ATTACH_PARENT, _unit, _target, objNull, _ropeLength, _ropeClass]] call CBA_fnc_addPerFrameHandler; [QGVAR(ropeDeployed), [_unit, _target, _ropeClass]] call CBA_fnc_localEvent; diff --git a/addons/towing/functions/fnc_towStateMachinePFH.sqf b/addons/towing/functions/fnc_towStateMachinePFH.sqf index 0adcce76e6..50afdeb153 100644 --- a/addons/towing/functions/fnc_towStateMachinePFH.sqf +++ b/addons/towing/functions/fnc_towStateMachinePFH.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Called per frame. Handles current unit state for attaching a rope to two vehicles + * Called per frame. Handles current unit state for attaching a rope to two vehicles. * * Arguments: * 0: PFEH Args @@ -51,7 +51,7 @@ private _exitCondition = !( || {getPosASLW _unit select 2 < -1.5} // walking-to-swimming animation in wetsuit lasts for 3 seconds } && { [_unit, objNull, [INTERACTION_EXCEPTIONS]] call EFUNC(common,canInteractWith) } && - { "unconscious" isNotEqualTo toLower animationState _unit } && + { "unconscious" isNotEqualTo toLowerANSI animationState _unit } && { !(_unit getVariable ["ACE_isUnconscious", false]) } && { ACE_player == _unit } ); @@ -62,14 +62,16 @@ if (_exitCondition && {_state < TOW_STATE_CANCEL}) then { switch (_state) do { case TOW_STATE_ATTACH_PARENT: { - TRACE_2("state attach parent",_unit,_parent); + // TRACE_2("state attach parent",_unit,_parent); [_unit, _parent, objNull, objNull, [0, 0, 0], _length] call FUNC(attachRopePFH); if (GVAR(canAttach) && { GVAR(mouseLeft) }) then { _args set [0, TOW_STATE_ATTACH_CHILD]; - _rope = ropeCreate [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper), _length]; - [GVAR(attachHelper), [0, 0, 0]] ropeAttachTo _rope; - + // can't use unit hand because rope doesn't change position when hand moving + // can't use createVehicleLocal because rope can be non-local (like parent) and it must be attached to global vehicle + GVAR(helper) = createVehicle [QGVAR(helper), [0, 0, 0], [], 0, "CAN_COLLIDE"]; + GVAR(helper) attachTo [_unit, [0, 0, 0], "LeftHand", true]; + _rope = ropeCreate [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual GVAR(attachHelper), GVAR(helper), [0, 0, 0], _length]; _args set [3, _rope]; }; @@ -79,7 +81,7 @@ switch (_state) do { }; }; case TOW_STATE_ATTACH_CHILD: { - TRACE_3("state attach child",_unit,_parent,_rope); + // TRACE_3("state attach child",_unit,_parent,_rope); [_unit, objNull, _parent, _rope, getPosASLVisual _rope, _length] call FUNC(attachRopePFH); if (GVAR(canAttach) && { GVAR(mouseLeft) }) then { @@ -108,60 +110,42 @@ switch (_state) do { GVAR(cancel) = false; }; - [QGVAR(setTowParent), [_parent, _child], _parent] call CBA_fnc_targetEvent; + detach GVAR(helper); + // can't delete GVAR(helper) without ropeDetach which requires local rope (==parent), so pass it to owner + if (isNull (_child getVariable [QGVAR(parent), objNull])) then { + [QGVAR(attachVehicles), [_parent, _child, _relativeAttachPos, _rope, GVAR(helper)]] call CBA_fnc_globalEvent; + } else { + [QGVAR(ropeAttachTo), [_child, _relativeAttachPos, _rope, GVAR(helper)], _parent] call CBA_fnc_targetEvent; + }; - GVAR(attachHelper) ropeDetach _rope; - [_child, _relativeAttachPos] ropeAttachTo _rope; + private _hookParent = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; + _hookParent attachTo [_parent, _parent worldToModelVisual ASLtoAGL getPosASLVisual _rope]; - private _hook = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "NONE"]; + private _hook = createVehicle [QGVAR(hook), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _hook attachTo [_child, _relativeAttachPos]; - _hook setVariable [QGVAR(parent), _parent, true]; - _hook setVariable [QGVAR(child), _child, true]; - _child setVariable [QGVAR(rope), _rope, true]; - _child setVariable [QGVAR(hook), _hook, true]; + // use array to decrease public setVar count + private _hookVars = [_parent, _child, _rope, _ropeClass, _hookParent]; + _hook setVariable [QGVAR(vars), _hookVars, true]; - _parent setVariable [QGVAR(hook), _hook, true]; + _hookParent setVariable [QGVAR(hook), _hook, true]; + _rope setVariable [QGVAR(hook), _hook, true]; - _hook setVariable [QGVAR(ropeClass), _ropeClass, true]; + private _childParentHooks = _child getVariable [QGVAR(parentHooks), []]; + _childParentHooks pushBack _hook; + _child setVariable [QGVAR(parentHooks), _childParentHooks, true]; - _child setVariable [QGVAR(towing), true, true]; - _parent setVariable [QGVAR(towing), true, true]; - - _hook setVariable [QGVAR(parentDeleteEventHandler), _parent addEventHandler ["Deleted", { - params ["_entity"]; - - private _hook = _entity getVariable [QGVAR(hook), objNull]; - private _child = _hook getVariable [QGVAR(child), objNull]; - private _parent = _hook getVariable [QGVAR(parent), objNull]; - - [objNull, _parent, _child] call FUNC(detach); - }], true]; - - _hook setVariable [QGVAR(childDeleteEventHandler), _child addEventHandler ["Deleted", { - params ["_entity"]; - - private _hook = _entity getVariable [QGVAR(hook), objNull]; - private _child = _hook getVariable [QGVAR(child), objNull]; - private _parent = _hook getVariable [QGVAR(parent), objNull]; - - [objNull, _parent, _child] call FUNC(detach); - }], true]; - - _parent setVariable [QGVAR(ropeBreakEventHandler), _parent addEventHandler ["RopeBreak", { - params ["_parent", "_rope", "_child"]; - - [objNull, _parent, _child] call FUNC(detach); - - _parent removeEventHandler ["RopeBreak", _parent getVariable QGVAR(ropeBreakEventHandler)]; - _parent setVariable [QGVAR(ropeBreakEventHandler), -1]; - }], true]; + private _parentChildHooks = _parent getVariable [QGVAR(childHooks), []]; + _parentChildHooks pushBack _hook; + _parent setVariable [QGVAR(childHooks), _parentChildHooks, true]; _args set [0, TOW_STATE_CLEANUP]; }; case TOW_STATE_CANCEL: { TRACE_1("state cancel",_rope); if !(isNull _rope) then { + detach GVAR(helper); + deleteVehicle GVAR(helper); ropeDestroy _rope; }; [_unit, _ropeClass, true] call CBA_fnc_addItem; @@ -174,6 +158,7 @@ switch (_state) do { TRACE_2("state cleanup",GVAR(attachHelper),_handle); deleteVehicle GVAR(attachHelper); [_handle] call CBA_fnc_removePerFrameHandler; + ["MouseButtonDown", GVAR(onMouseButtonDownEHID)] call CBA_fnc_removeDisplayHandler; _unit setVariable [QGVAR(hint), []]; call EFUNC(interaction,hideMouseHint); if (GVAR(blockFireEHID) != -1) then { diff --git a/addons/towing/initSettings.inc.sqf b/addons/towing/initSettings.inc.sqf index 03d20781cb..dbfe326d4c 100644 --- a/addons/towing/initSettings.inc.sqf +++ b/addons/towing/initSettings.inc.sqf @@ -7,7 +7,8 @@ { if !(_this && {isServer} && {isNil QGVAR(addRopeToVehicleInventory_initialized)}) exitWith {}; GVAR(addRopeToVehicleInventory_initialized) = true; - ["Tank", "initPost", LINKFUNC(addRopeToVehicle), true, [], true] call CBA_fnc_addClassEventHandler; - ["Car", "initPost", LINKFUNC(addRopeToVehicle), true, [], true] call CBA_fnc_addClassEventHandler; + { + [_x, "initPost", LINKFUNC(addRopeToVehicle), true, [], true] call CBA_fnc_addClassEventHandler; + } forEach ["Car", "Ship", "Tank"]; } ] call CBA_fnc_addSetting; diff --git a/addons/towing/script_component.hpp b/addons/towing/script_component.hpp index 2d9790ac20..c52e84046e 100644 --- a/addons/towing/script_component.hpp +++ b/addons/towing/script_component.hpp @@ -24,4 +24,3 @@ #define TOW_STATE_ATTACH 2 #define TOW_STATE_CANCEL 3 #define TOW_STATE_CLEANUP 4 - diff --git a/addons/trenches/XEH_postInit.sqf b/addons/trenches/XEH_postInit.sqf index ea8ff7e24f..59a6fb8a08 100644 --- a/addons/trenches/XEH_postInit.sqf +++ b/addons/trenches/XEH_postInit.sqf @@ -27,11 +27,11 @@ GVAR(digDirection) = 0; ["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel dig on player change. This does work when returning to lobby, but not when hard disconnecting. -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; -["loadout", FUNC(handlePlayerInventoryChanged)] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["loadout", LINKFUNC(handlePlayerInventoryChanged)] call CBA_fnc_addPlayerEventHandler; ["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle waking up dragged unit and falling unconscious while dragging -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler; //@todo Captivity? diff --git a/addons/trenches/functions/fnc_blockTrench_place.sqf b/addons/trenches/functions/fnc_blockTrench_place.sqf index f602a871e0..4c0a218307 100644 --- a/addons/trenches/functions/fnc_blockTrench_place.sqf +++ b/addons/trenches/functions/fnc_blockTrench_place.sqf @@ -63,10 +63,10 @@ private _east = (abs (_ax - _bx)) >= (abs (_ay - _by)); private _origin2D = []; private _length = 0; if (_east) then { - _origin2D = if (_ax < _bx) then { _start2d } else { _end2d }; + _origin2D = [_end2d, _start2d] select (_ax < _bx); _length = (abs (_ax - _bx)) / _cellsize; } else { - _origin2D = if (_ay < _by) then { _start2d } else { _end2d }; + _origin2D = [_end2d, _start2d] select (_ay < _by); _length = (abs (_ay - _by)) / _cellsize; }; TRACE_3("",_east,_origin2D,_length); diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 6e029cb4c0..4b47ee6a14 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -282,7 +282,7 @@ Time, in seconds, required to dig a small trench. Время в секундах, необходимое для рытья малого окопа Définit le temps nécessaire au déploiement des petites tranchées (en secondes). - 小型塹壕の造成が完了するまで掛かる時間 (秒) を設定できます。 + 小型塹壕の造成が完了するまで掛かる時間。 (秒単位) Tiempo, en segundos, requerido para cavar una trinchera pequeña. Czas, w sekundach wymagany do wykopania małego okopu Zeit in Sekunden, um einen kleinen Graben auszuheben. @@ -306,7 +306,7 @@ Time, in seconds, required to remove a small trench. Время в секундах, необходимое для удаления малого окопа Définit le temps nécessaire pour le retrait des petites tranchées (en secondes). - 小型塹壕の撤去が完了するまで掛かる時間 (秒) を設定できます。 + 小型塹壕の撤去が完了するまで掛かる時間。 (秒単位) Tiempo, en segundos, requerido para eliminar una trinchera pequeña. Czas, w sekundach wymagany do usunięcia małego okopu Zeit in Sekunden, um einen kleinen Graben aufzuschütten. @@ -330,7 +330,7 @@ Time, in seconds, required to dig a big trench. Время в секундах, необходимое для рытья большого окопа Définit le temps nécessaire au déploiement des grandes tranchées (en secondes). - 大型塹壕の造成が完了するまで掛かる時間 (秒) を設定できます。 + 大型塹壕の造成が完了するまで掛かる時間。 (秒単位) Tiempo, en segundos, requerido para cavar una trinchera grande Czas, w sekundach wymagany do wykopania dużego okopu Zeit in Sekunden, um einen großen Graben auszuheben. @@ -354,7 +354,7 @@ Time, in seconds, required to remove a big trench. Время в секундах, необходимое для удаления большого окопа Définit le temps nécessaire pour le retrait des grandes tranchées (en secondes). - 大型塹壕の撤去が完了するまで掛かる時間 (秒) を設定できます。 + 大型塹壕の撤去が完了するまで掛かる時間。 (秒単位) Tiempo, en segundos, requerido para eliminar una trinchera grande Czas, w sekundach wymagany do usunięcia dużego okopu Zeit in Sekunden, um einen großen Graben aufzuschütten. diff --git a/addons/tripod/XEH_postInit.sqf b/addons/tripod/XEH_postInit.sqf index 9fbfaa6c8d..febd71390b 100644 --- a/addons/tripod/XEH_postInit.sqf +++ b/addons/tripod/XEH_postInit.sqf @@ -10,10 +10,10 @@ GVAR(height) = 0.5; ["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel adjusting on player change. -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; ["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle falling unconscious -["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler; // @todo captivity? diff --git a/addons/tripod/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf index db31a0733f..b7cdc842e9 100644 --- a/addons/tripod/functions/fnc_adjust.sqf +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -35,8 +35,7 @@ GVAR(adjustPFH) = [{ { _tripod animate [_x, 1 - GVAR(height)]; - } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; - + } forEach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; }, 0, [_unit, _tripod]] call CBA_fnc_addPerFrameHandler; [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); diff --git a/addons/tripod/functions/fnc_place.sqf b/addons/tripod/functions/fnc_place.sqf index ecefe12784..0109990ded 100644 --- a/addons/tripod/functions/fnc_place.sqf +++ b/addons/tripod/functions/fnc_place.sqf @@ -34,7 +34,7 @@ if (stance _unit == "STAND") then { { _tripod animate [_x, 0.5]; - } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; + } forEach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; [{ (_this select 0) params ["_tripod", "_direction", "_position"]; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 66aa0b3650..1ef328b176 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -19,9 +19,8 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace; ["ace_infoDisplayChanged", { // Selective UI Advanced // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified - private _force = [true, false] select (GVAR(allowSelectiveUI)); { - [_x, missionNamespace getVariable (format [QGVAR(%1), _x]), false, _force] call FUNC(setAdvancedElement); + [_x, missionNamespace getVariable (format [QGVAR(%1), _x]), false, !GVAR(allowSelectiveUI)] call FUNC(setAdvancedElement); } forEach (allVariables GVAR(configCache)); // Execute local event for when it's safe to modify UI through this API @@ -40,7 +39,7 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace; if (_name in ELEMENTS_BASIC) then { [true] call FUNC(setElements); } else { - private _nameNoPrefix = toLower (_name select [7]); + private _nameNoPrefix = toLowerANSI (_name select [7]); private _cachedElement = GVAR(configCache) getVariable _nameNoPrefix; if (!isNil "_cachedElement") then { [_nameNoPrefix, _value, true] call FUNC(setAdvancedElement); @@ -49,4 +48,4 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace; }] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; -["unit", FUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/ui/functions/fnc_compileConfigUI.sqf b/addons/ui/functions/fnc_compileConfigUI.sqf index 17eaa27308..ef6ec1026a 100644 --- a/addons/ui/functions/fnc_compileConfigUI.sqf +++ b/addons/ui/functions/fnc_compileConfigUI.sqf @@ -17,7 +17,7 @@ { private _failure = false; - private _class = toLower (configName _x); + private _class = toLowerANSI (configName _x); private _idd = getNumber (_x >> "idd"); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 3771bf840b..6751d9700c 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -68,7 +68,7 @@ if (!_force) then { }; private _displays = ((uiNamespace getVariable "IGUI_displays") + [findDisplay IDD_MISSION]) select {_idd == ctrlIDD _x}; -private _fade = [1, 0] select _show; +private _fade = parseNumber !_show; // Disable/Enable elements private _success = false; diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf index 89b8684af7..f7f8dccd0c 100644 --- a/addons/ui/functions/fnc_setElementVisibility.sqf +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -29,7 +29,7 @@ if (_source == "" || {_element == ""}) exitWith { WARNING("Source or Element may not be empty strings!"); }; -_element = toLower _element; +_element = toLowerANSI _element; // Verify element is bound private _cachedElement = GVAR(configCache) getVariable _element; diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index 24a22a5782..082f22e483 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -38,7 +38,7 @@ private _fnc_setPFH = { }; GVAR(currentMode) = _this; - GVAR(holdKeyHandler) = [FUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler; + GVAR(holdKeyHandler) = [LINKFUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler; }; switch (_this select 0) do { diff --git a/addons/vector/functions/fnc_onKeyUp.sqf b/addons/vector/functions/fnc_onKeyUp.sqf index 11310eb5cf..b660331e65 100644 --- a/addons/vector/functions/fnc_onKeyUp.sqf +++ b/addons/vector/functions/fnc_onKeyUp.sqf @@ -22,7 +22,7 @@ private _fnc_setPFH = { }; GVAR(currentMode) = _this;// - GVAR(holdKeyHandler) = [FUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler; + GVAR(holdKeyHandler) = [LINKFUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler; }; switch (_this select 0) do { diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index ffd64cc77f..a7e59c75a1 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -35,7 +35,7 @@ private _slatHitpoints = [_vehicleConfig >> QGVAR(slatHitpoints), "ARRAY", []] c { _x params ["_hitpoints", "_type"]; { - [_hitpointHash, toLower _x, [_type, _hitpointsConfig >> _x, _x]] call CBA_fnc_hashSet; + [_hitpointHash, toLowerANSI _x, [_type, _hitpointsConfig >> _x, toLowerANSI _x]] call CBA_fnc_hashSet; } forEach _hitpoints; } forEach ALL_HITPOINTS; @@ -45,7 +45,7 @@ _vehicle setVariable [QGVAR(hitpointHash), _hitpointHash]; private _iterateThroughConfig = { params ["_vehicle", "_config", "_iterateThroughConfig", "_hitpointAliases"]; TRACE_1("checking config",_config); - private _configName = configName _config; + private _configName = toLowerANSI configName _config; private _isGun = ([_config >> "isGun", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; private _isTurret = ([_config >> "isTurret", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; private _isEra = _configName in _eraHitpoints; @@ -53,18 +53,18 @@ private _iterateThroughConfig = { private _isMisc = false; // prevent incompatibilites with old mods - if ((toLower _configName) isEqualTo "hitturret") then { + if (_configName isEqualTo "hitturret") then { _isTurret = true; }; - if ((toLower _configName) isEqualTo "hitgun") then { + if (_configName isEqualTo "hitgun") then { _isGun = true; }; private _hash = _vehicle getVariable QGVAR(hitpointHash); { _x params ["_hitType", "_hitPoints"]; - if ((toLower _configName) in _hitPoints) then { - [_hash, toLower _configName, [_hitType, _config, _configName]] call CBA_fnc_hashSet; + if (_configName in _hitPoints) then { + [_hash, _configName, [_hitType, _config, _configName]] call CBA_fnc_hashSet; _isMisc = true; }; } forEach _hitpointAliases; @@ -72,16 +72,16 @@ private _iterateThroughConfig = { if (_isGun || _isTurret || _isEra || _isSlat || _isMisc) then { TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hash); if (_isGun) then { - [_hash, toLower _configName, ["gun", _config, _configName]] call CBA_fnc_hashSet; + [_hash, _configName, ["gun", _config, _configName]] call CBA_fnc_hashSet; }; if (_isTurret) then { - [_hash, toLower _configName, ["turret", _config, _configName]] call CBA_fnc_hashSet; + [_hash, _configName, ["turret", _config, _configName]] call CBA_fnc_hashSet; }; if (_isEra) then { - [_hash, toLower _configName, ["era", _config, _configName]] call CBA_fnc_hashSet; + [_hash, _configName, ["era", _config, _configName]] call CBA_fnc_hashSet; }; if (_isSlat) then { - [_hash, toLower _configName, ["slat", _config, _configName]] call CBA_fnc_hashSet; + [_hash, _configName, ["slat", _config, _configName]] call CBA_fnc_hashSet; }; _vehicle setVariable [QGVAR(hitpointHash), _hash]; } else { @@ -103,7 +103,7 @@ if (isNil "_eh") then { // Maybe its overridden somewhere else, but this makes sure it is the last one [{ params ["_vehicle"]; - TRACE_1("EH not added yet - added eh now", _vehicle); + TRACE_1("EH not added yet - added eh now",_vehicle); private _hd = _vehicle addEventHandler ["HandleDamage", { _this call FUNC(handleDamage) }]; _vehicle setVariable [QGVAR(handleDamage), _hd]; }, [_vehicle]] call CBA_fnc_execNextFrame; diff --git a/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf b/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf index 813e97a766..4e847c2d36 100644 --- a/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf +++ b/addons/vehicle_damage/functions/fnc_calculatePenetrationInfo.sqf @@ -83,7 +83,7 @@ _projectileData params ["_projectileType", "_projectileConfig"]; private _enabled = ([_hitpointConfig >> QGVAR(enabled), "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1; #define MATERIAL_ARRAY ([[0, 0, 0, 0, 0, 0], "steel", [7850, 500, 1.104, 9874, 0.3598, -0.2342], "tungsten", [19300, 0, 0.994, 134.5, -0.148], "depleted_uranium", [18600, 0, 0.825, 90, -0.0849]]) private _rodMaterialStr = [_projectileConfig >> QGVAR(material), "STRING", "tungsten"] call CBA_fnc_getConfigEntry; -private _rodMaterialParams = MATERIAL_ARRAY select (1 + MATERIAL_ARRAY find toLower _rodMaterial); +private _rodMaterialParams = MATERIAL_ARRAY select (1 + MATERIAL_ARRAY find toLowerANSI _rodMaterial); if !(_enabled) exitWith { [false, 0, 0, 0, 0] }; if (_rodMaterialParams isEqualTo [0, 0, 0, 0, 0, 0]) exitWith { [] }; diff --git a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf index a6e7335542..7cf6337796 100644 --- a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf +++ b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf @@ -40,7 +40,7 @@ if (!_alreadyCookingOff && { _chanceOfFire >= random 1 }) exitWith { private _detonateAfterCookoff = (_fireDetonateChance / 4) > random 1; private _source = ""; - if (toLower _hitPart isEqualTo "engine") then { + if (_hitPart == "engine") then { _source = ["hit_engine_point", "HitPoints"]; }; diff --git a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf index 01f098efb0..e18d8a3814 100644 --- a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf @@ -34,7 +34,7 @@ if !(alive _vehicle) exitWith { true }; -_hitPoint = toLower _hitPoint; +_hitPoint = toLowerANSI _hitPoint; private _hitpointHash = _vehicle getVariable [QGVAR(hitpointHash), []]; private _type = if (_hitpointHash isEqualTo []) then { "exit" diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index 48d6ec0055..73e70bbf57 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -124,7 +124,7 @@ private _chanceOfDetonation = 0; private _explosiveAmmoCount = 0; private _nonExplosiveAmmoCount = 0; -if (count (_currentVehicleAmmo select 0) isNotEqualTo 0) then { +if ((_currentVehicleAmmo select 0) isNotEqualTo []) then { private _magConfig = configFile >> "CfgMagazines"; private _ammoConfig = configFile >> "CfgAmmo"; private _countOfExplodableAmmo = 0; @@ -248,7 +248,7 @@ switch (_hitArea) do { }; { - TRACE_1("doing damage to hitpoint", _x); + TRACE_1("doing damage to hitpoint",_x); [_vehicle, -1, _x, 1 * _penChance] call FUNC(addDamage); } forEach _partKill; @@ -270,7 +270,7 @@ switch (_hitArea) do { }; if (0.8 * _ammoEffectiveness > random 1) then { - TRACE_1("damaged turret", _ammoEffectiveness * 0.8); + TRACE_1("damaged turret",_ammoEffectiveness * 0.8); [_vehicle, _hitIndex, _hitpointName, 1 * _penChance] call FUNC(addDamage); _vehicle setVariable [QGVAR(canShoot), false]; }; diff --git a/addons/vehiclelock/XEH_postInit.sqf b/addons/vehiclelock/XEH_postInit.sqf index 40afaf32af..d16b47aef5 100644 --- a/addons/vehiclelock/XEH_postInit.sqf +++ b/addons/vehiclelock/XEH_postInit.sqf @@ -1,14 +1,14 @@ #include "script_component.hpp" //Add Event Handlers -[QGVAR(setupCustomKey), {_this call FUNC(serverSetupCustomKeyEH)}] call CBA_fnc_addEventHandler; -[QGVAR(setVehicleLock), {_this call FUNC(setVehicleLockEH)}] call CBA_fnc_addEventHandler; +[QGVAR(setupCustomKey), LINKFUNC(serverSetupCustomKeyEH)] call CBA_fnc_addEventHandler; +[QGVAR(setVehicleLock), LINKFUNC(setVehicleLockEH)] call CBA_fnc_addEventHandler; ["CBA_settingsInitialized", { TRACE_2("SettingsInitialized eh",GVAR(LockVehicleInventory),GVAR(VehicleStartingLockState)); if (hasInterface && {GVAR(LockVehicleInventory)}) then { - ["CAManBase", "InventoryOpened", {_this call FUNC(onOpenInventory)}] call CBA_fnc_addClassEventHandler; + ["CAManBase", "InventoryOpened", LINKFUNC(onOpenInventory)] call CBA_fnc_addClassEventHandler; }; if (isServer && {GVAR(VehicleStartingLockState) != -1}) then { [{ diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index d730589b36..6461e7fca2 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -30,7 +30,7 @@ if (_useCustom) then { private _previousMags = magazinesDetail _unit; _unit addMagazine ["ACE_key_customKeyMagazine", 1]; //addMagazine array has global effects private _newMags = (magazinesDetail _unit) - _previousMags; - if ((count _newMags) == 0) exitWith {ERROR("failed to add magazine (inventory full?)");}; + if (_newMags isEqualTo []) exitWith {ERROR("failed to add magazine (inventory full?)");}; private _keyMagazine = _newMags select 0; TRACE_2("setting up key on server",_veh,_keyMagazine); //Have the server run add the key to the vehicle's key array: diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 03562a6180..f8ccc59a0f 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -37,10 +37,10 @@ if (GVAR(LockVehicleInventory) && //if setting not enabled !isNull (findDisplay 602) }, { - TRACE_1("car display open: closing", _this); + TRACE_1("car display open: closing",_this); (findDisplay 602) closeDisplay 0; [{ - TRACE_1("Opening Player Inventory", _this); + TRACE_1("Opening Player Inventory",_this); ACE_player action ["Gear", objNull]; }, []] call CBA_fnc_execNextFrame; }, []] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index c34dbb78e2..7b99f093a7 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -20,5 +20,5 @@ params ["_veh", "_isLocked"]; TRACE_2("params",_veh,_isLocked); private _lockNumber = [0, 2] select _isLocked; -TRACE_2("Setting Lock State", _veh, _lockNumber); +TRACE_2("Setting Lock State",_veh,_lockNumber); _veh lock _lockNumber; diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index 55600489e8..7cfa58d07a 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -365,7 +365,7 @@ Alapértelmezett idő a zárfeltöréshez (másodpercben). Alapértelmezett: 10 Время для взлома замка отмычкой (в секундах). По умолчанию: 10 Tempo Default richiesto per forzare serrature (in secondi). Predefinito: 10 - Lockpickを使った作業の所要時間の標準設定。(秒) デフォルト: 10 + Lockpickを使った作業の所要時間の標準設定。 (秒単位) デフォルト: 10 해정을 위해 들이는 기본시간입니다(초 단위). 기본설정: 10 开锁时间(秒)。预设:10 開鎖時間(秒)。預設:10 diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 84ba31d285..b7fb192db2 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -41,7 +41,7 @@ if (_objectViewDistanceCoeff isEqualType 0) then { } else { if (isNil QGVAR(fovBasedPFHminimalViewDistance)) then { GVAR(fovBasedPFHminimalViewDistance) = getObjectViewDistance select 0; // Minimal view distance holder and PFH isRunning variable - [FUNC(setFovBasedOvdPFH), 0, []] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(setFovBasedOvdPFH), 0, []] call CBA_fnc_addPerFrameHandler; }; }; diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index 0d97fe1f96..eb7ed94838 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -96,7 +96,7 @@ Korlátozza, mekkora látótávolságot állíthatnak be a kliensek (maximum 10000-ig) Устанавливает предел дальности, насколько клиенты могут увеличить свою дальность видимости (до 10000) Imposta il limite massimo a cui i client possono alzare la propria distanza visiva (massimo 10000) - 各クライアントが設定できる視界距離の上限を設定します。(最大 10000) + 各クライアントが設定できる視界距離の上限 (最大 10000) 클라이언트가 최대 얼마나 멀리 볼 수 있는지 제한을 둡니다 (10000 까지 가능) 设定客户端最高可显示的视距(最高至10000) 設定客戶端最高可顯示的視野距離 (最高至10000) @@ -128,6 +128,7 @@ 0に設定すると、デフォルトのビデオ設定が使用されます Значение 0 будет использовать настройки видео по умолчанию Establecer a 0 utiliza las opciones de video por defecto + La valeur 0 permet d'utiliser les paramètres vidéo par défaut Client View Distance (On Foot) diff --git a/addons/viewports/dev/debugPoints.sqf b/addons/viewports/dev/debugPoints.sqf index 24b393d70f..53fe016b62 100644 --- a/addons/viewports/dev/debugPoints.sqf +++ b/addons/viewports/dev/debugPoints.sqf @@ -22,7 +22,7 @@ #define IDD_3DEN 313 [] spawn { - INFO_2("Pre-Init [is3den %1][3den display: %2]", is3den, !isNull findDisplay IDD_3DEN); + INFO_2("Pre-Init [is3den %1][3den display: %2]",is3den,!isNull findDisplay IDD_3DEN); if (!is3den) exitWith {}; GVAR(3denIndex) = 0; diff --git a/addons/viewports/functions/fnc_eachFrame.sqf b/addons/viewports/functions/fnc_eachFrame.sqf index 6bb452baad..068a5edcf5 100644 --- a/addons/viewports/functions/fnc_eachFrame.sqf +++ b/addons/viewports/functions/fnc_eachFrame.sqf @@ -36,7 +36,7 @@ if (cba_events_control) then { _shownIndex = -1; }; - ([_player] call FUNC(getSeatInfo)) params ["_role", "", "", "_comparment"]; + ([_player] call FUNC(getSeatInfo)) params ["_role", "", "", "_compartment"]; private _newIndexAngle = 45; // Controls the max angle private _eyesPosASL = AGLtoASL (positionCameraToWorld [0, 0, 0]); @@ -52,8 +52,8 @@ if (cba_events_control) then { #endif if ( (_viewAngle < _newIndexAngle) - && {(_compartments isEqualTo []) || {(toLower _comparment) in _compartments}} - && {(_roles isEqualTo []) || {(toLower _role) in _roles}} + && {(_compartments isEqualTo []) || {(toLowerANSI _compartment) in _compartments}} + && {(_roles isEqualTo []) || {(toLowerANSI _role) in _roles}} && {(vectorMagnitude _viewDiff) < _maxDistance} ) then { _newIndex = _forEachIndex; diff --git a/addons/viewports/functions/fnc_getViewports.sqf b/addons/viewports/functions/fnc_getViewports.sqf index 32f97e18f6..744b973151 100644 --- a/addons/viewports/functions/fnc_getViewports.sqf +++ b/addons/viewports/functions/fnc_getViewports.sqf @@ -61,9 +61,9 @@ if (isNil "_viewports") then { _maxDistance = 0.8; }; // compartments [ARRAY] - Optional - private _compartments = (getArray (_x >> "compartments")) apply {toLower _x}; + private _compartments = (getArray (_x >> "compartments")) apply {toLowerANSI _x}; // roles [ARRAY] - Optional - private _roles = (getArray (_x >> "roles")) apply {toLower _x}; + private _roles = (getArray (_x >> "roles")) apply {toLowerANSI _x}; [_name, _type, _camLocation, _camAttach, _screenLocation, _maxDistance, _compartments, _roles] }; diff --git a/addons/viewrestriction/XEH_clientInit.sqf b/addons/viewrestriction/XEH_clientInit.sqf index 21455af21b..1ed4f008da 100644 --- a/addons/viewrestriction/XEH_clientInit.sqf +++ b/addons/viewrestriction/XEH_clientInit.sqf @@ -19,7 +19,7 @@ if !(hasInterface) exitWith {}; }; // Exit if third person view is not available - if (difficultyOption "thirdPersonView" == 0) exitWith { + if (difficultyOption "thirdPersonView" != 1) exitWith { WARNING("View Restriction is enabled, but 3rd person is disabled with server difficulty."); }; diff --git a/addons/volume/XEH_postInitClient.sqf b/addons/volume/XEH_postInitClient.sqf index 2ce8f03a10..896bb718f8 100644 --- a/addons/volume/XEH_postInitClient.sqf +++ b/addons/volume/XEH_postInitClient.sqf @@ -23,7 +23,7 @@ if (!hasInterface) exitWith {}; if (!XGVAR(lowerInVehicles)) exitWith {}; - if (vehicle _unit != _unit) then { + if (!isNull objectParent _unit) then { call FUNC(lowerVolume); } else { call FUNC(restoreVolume); diff --git a/addons/volume/stringtable.xml b/addons/volume/stringtable.xml index ea0eabf4eb..feecb28b10 100644 --- a/addons/volume/stringtable.xml +++ b/addons/volume/stringtable.xml @@ -168,7 +168,7 @@ Time it takes (in seconds) for the sound to fade in/out. Zeit, die es benötigt (in Sekunden), für das Geräusch, ein- bzw. auszublenden. - 音がフェードイン/アウトするまでの時間 (秒) を決定します。 + 音がフェードイン/アウトするまでの時間。 (秒単位) Temps nécessaire (en secondes) aux sons pour être réduits/rétablis. 페이드 인/아웃 되는데 걸리는 시간(초) 设定音量淡出/入时所需的秒数。 diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 4d2c6464b2..77a2fc673b 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -210,4 +210,4 @@ if (!hasInterface) exitWith {}; [0, [false, false, false]]] call CBA_fnc_addKeybind; // Register fire event handler -["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 25d6b9b5d5..92ba1b06a6 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -21,10 +21,8 @@ GVAR(GrenadesNonFrag) = []; private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); ([GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select (_explosive == 0)) pushBack _x; - false - } count _magazines; - false -} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); + } forEach _magazines; +} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); #include "initSettings.inc.sqf" diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 16bac855cc..8b9fcf94b7 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -22,7 +22,7 @@ private _weapons = _vehicle weaponsTurret _turret; if ( count _weapons > 1 - || {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ... + || {_weapons isNotEqualTo [] && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ... ) then { //This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead. diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 2be2d740ea..fc55b54b5f 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -30,7 +30,7 @@ _sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0] if (_filename == "") exitWith {}; // add file extension .wss as default -if !(toLower (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { +if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { _filename = format ["%1.wss", _filename]; }; diff --git a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf index 195bbc326b..ff111a93f6 100644 --- a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf +++ b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf @@ -37,8 +37,7 @@ private _grenades = []; if (_x in _magazines) then { _grenades pushBack _x; }; - false -} count ([GVAR(GrenadesAll), GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select _type); +} forEach ([GVAR(GrenadesAll), GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select _type); // abort if no grenades are available if (_grenades isEqualTo []) exitWith {false}; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index 4856a7b738..ffe289a589 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (_weapon != "Throw") exitWith {}; diff --git a/addons/weather/XEH_PREP.hpp b/addons/weather/XEH_PREP.hpp index 5f17905849..220a18ef3c 100644 --- a/addons/weather/XEH_PREP.hpp +++ b/addons/weather/XEH_PREP.hpp @@ -1,9 +1,9 @@ - PREP(calculateAirDensity); PREP(calculateBarometricPressure); PREP(calculateDensityAltitude); PREP(calculateDewPoint); PREP(calculateHeatIndex); +PREP(calculateOxygenDensity); PREP(calculateRoughnessLength); PREP(calculateSpeedOfSound); PREP(calculateTemperatureAtHeight); diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index 51350226e1..98909dc2d4 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -1,10 +1,12 @@ #include "script_component.hpp" GVAR(WindInfo) = false; + ["ACE3 Common", QGVAR(WindInfoKey), localize LSTRING(WindInfoKeyToggle), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotDragging", "isNotCarrying", "isNotSitting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !(isNull objectParent ACE_player || {objectParent ACE_player isKindOf "StaticWeapon"}) exitWith {false}; // Statement [] call FUNC(displayWindInfo); @@ -15,7 +17,8 @@ GVAR(WindInfo) = false; ["ACE3 Common", QGVAR(WindInfoKey_hold), localize LSTRING(WindInfoKeyHold), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotDragging", "isNotCarrying", "isNotSitting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !(isNull objectParent ACE_player || {objectParent ACE_player isKindOf "StaticWeapon"}) exitWith {false}; // Statement [] call FUNC(displayWindInfo); diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index da694bb5f1..2c20f672fe 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -9,8 +9,8 @@ if (GVAR(windSimulation)) then { call FUNC(initWind); - [FUNC(updateWind), 1] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(updateWind), 1] call CBA_fnc_addPerFrameHandler; }; - [FUNC(updateWeather), GVAR(updateInterval)] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(updateWeather), GVAR(updateInterval)] call CBA_fnc_addPerFrameHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/weather/functions/fnc_calculateOxygenDensity.sqf b/addons/weather/functions/fnc_calculateOxygenDensity.sqf new file mode 100644 index 0000000000..542b4b2f10 --- /dev/null +++ b/addons/weather/functions/fnc_calculateOxygenDensity.sqf @@ -0,0 +1,20 @@ +#include "..\script_component.hpp" +/* + * Author: Brett Mayson + * Calculates the oxygen density + * + * Arguments: + * 0: Temperature - °C + * 1: Pressure - hPa + * 2: Relative humidity - value between 0.0 and 1.0 + * + * Return Value: + * Density of oxygen - kg * m^(-3) + * + * Example: + * [0, 1020] call ace_weather_fnc_calculateOxygenDensity + * + * Public: No + */ + +(_this call FUNC(calculateAirDensity)) * 0.21 diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf index 2ae1d94eec..cd73fac358 100644 --- a/addons/weather/functions/fnc_calculateWindSpeed.sqf +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -58,8 +58,7 @@ if (_terrainEffectEnabled) then { if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; - nil - } count [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; _windSpeed = _newWindSpeed; }; }; @@ -81,8 +80,7 @@ if (_obstacleEffectEnabled) then { if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; - nil - } count [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; + } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; _windSpeed = _newWindSpeed; }; }; diff --git a/addons/weather/functions/fnc_displayAirTemp.sqf b/addons/weather/functions/fnc_displayAirTemp.sqf index 4eb5bdf3ac..08b325dcac 100644 --- a/addons/weather/functions/fnc_displayAirTemp.sqf +++ b/addons/weather/functions/fnc_displayAirTemp.sqf @@ -17,7 +17,7 @@ */ params ["_apparent_temperature", "_bias"]; -TRACE_2("displayAirTemp",_apparent_temperature, _bias); +TRACE_2("displayAirTemp",_apparent_temperature,_bias); private _temperature1 = floor(_apparent_temperature + (_bias select 0) - (random 2)); private _temperature2 = floor(_apparent_temperature + (_bias select 1) + (random 2)); diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index d7c45e595a..aeb7d580ae 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -29,14 +29,20 @@ EGVAR(advanced_ballistics,Protractor) = false; GVAR(WindInfo) = true; -TRACE_1("Starting Wind Info PFEH", GVAR(WindInfo)); +TRACE_1("Starting Wind Info PFEH",GVAR(WindInfo)); [{ disableSerialization; params ["", "_pfID"]; - if ((!GVAR(WindInfo)) || {!([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith))}) exitWith { - TRACE_1("Ending Wind Info PFEH", GVAR(WindInfo)); + // Allow wind indicator inside static weapons + private _playerInStaticWeapon = objectParent ACE_Player isKindOf "StaticWeapon"; + + if ( + (!GVAR(WindInfo)) || + {!([ACE_player, ACE_player, ["notOnMap", "isNotDragging", "isNotCarrying", "isNotSitting"]] call EFUNC(common,canInteractWith)) && !(_playerInStaticWeapon)} + ) exitWith { + TRACE_1("Ending Wind Info PFEH",GVAR(WindInfo)); GVAR(WindInfo) = false; (["RscWindIntuitive"] call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; [_pfID] call CBA_fnc_removePerFrameHandler; @@ -45,12 +51,18 @@ TRACE_1("Starting Wind Info PFEH", GVAR(WindInfo)); //Keeps the display open: (["RscWindIntuitive"] call BIS_fnc_rscLayer) cutRsc ["RscWindIntuitive", "PLAIN", 1, false]; + private _playerEyePos = eyePos ACE_Player; + if (_playerInStaticWeapon) then { + // Raise eyePos by 1 meter if player is in a static weapon, to prevent wind from being blocked by the open vehicle + _playerEyePos = _playerEyePos vectorAdd [0, 0, 1]; + }; + private _windSpeed = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { // With wind gradient - [eyePos ACE_player, true, true, true] call FUNC(calculateWindSpeed); + [_playerEyePos, true, true, true] call FUNC(calculateWindSpeed); } else { // Without wind gradient - [eyePos ACE_player, false, true, true] call FUNC(calculateWindSpeed); + [_playerEyePos, false, true, true] call FUNC(calculateWindSpeed); }; diff --git a/addons/weather/functions/fnc_getApproximateAirTemp.sqf b/addons/weather/functions/fnc_getApproximateAirTemp.sqf index 33227907a3..91b8af3fcc 100644 --- a/addons/weather/functions/fnc_getApproximateAirTemp.sqf +++ b/addons/weather/functions/fnc_getApproximateAirTemp.sqf @@ -18,7 +18,7 @@ params ["_unit"]; TRACE_1("params",_unit); -if (isNil (format ["%1", _unit getVariable "ACE_airTemperatureBias"])) then { +if (isNil {_unit getVariable "ACE_airTemperatureBias"}) then { _unit setVariable ["ACE_airTemperatureBias", [-(random(3) + 1), random(3) + 1]]; }; diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf index d80573c286..555704fc87 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -15,7 +15,7 @@ * Public: No */ -private _worldName = toLower worldName; +private _worldName = toLowerANSI worldName; TRACE_1("getting map data",_worldName); // Set default values @@ -48,34 +48,35 @@ GVAR(currentHumidity) = 0; GVAR(currentOvercast) = 0; // Get all non inherited arrays to filter maps that inherit from Stratis/Altis/Tanoa -private _nonInheritedArrays = configProperties [configFile >> "CfgWorlds" >> _worldName, "isArray _x", false]; +private _cfgPath = configFile >> "CfgWorlds" >> _worldName; +private _nonInheritedArrays = configProperties [_cfgPath, "isArray _x", false]; // And check if any custom non-inherited weather is defined through config and use that if so -if ((configFile >> "CfgWorlds" >> _worldName >> "ACE_TempDay") in _nonInheritedArrays) exitWith { - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempDay")) then { - GVAR(TempDay) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempDay"); +if ((_cfgPath >> "ACE_TempDay") in _nonInheritedArrays) exitWith { + if (isArray (_cfgPath >> "ACE_TempDay")) then { + GVAR(TempDay) = getArray (_cfgPath >> "ACE_TempDay"); }; - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempNight")) then { - GVAR(TempNight) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_TempNight"); + if (isArray (_cfgPath >> "ACE_TempNight")) then { + GVAR(TempNight) = getArray (_cfgPath >> "ACE_TempNight"); }; - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_Humidity")) then { - GVAR(Humidity) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_Humidity"); + if (isArray (_cfgPath >> "ACE_Humidity")) then { + GVAR(Humidity) = getArray (_cfgPath >> "ACE_Humidity"); }; - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMin")) then { - GVAR(WindSpeedMin) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMin"); + if (isArray (_cfgPath >> "ACE_WindSpeedMin")) then { + GVAR(WindSpeedMin) = getArray (_cfgPath >> "ACE_WindSpeedMin"); }; - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMean")) then { - GVAR(WindSpeedMean) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMean"); + if (isArray (_cfgPath >> "ACE_WindSpeedMean")) then { + GVAR(WindSpeedMean) = getArray (_cfgPath >> "ACE_WindSpeedMean"); }; - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMax")) then { - GVAR(WindSpeedMax) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindSpeedMax"); + if (isArray (_cfgPath >> "ACE_WindSpeedMax")) then { + GVAR(WindSpeedMax) = getArray (_cfgPath >> "ACE_WindSpeedMax"); }; - if (isArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindDirectionProbabilities")) then { - GVAR(WindDirectionProbabilities) = getArray (configFile >> "CfgWorlds" >> _worldName >> "ACE_WindDirectionProbabilities"); + if (isArray (_cfgPath >> "ACE_WindDirectionProbabilities")) then { + GVAR(WindDirectionProbabilities) = getArray (_cfgPath >> "ACE_WindDirectionProbabilities"); }; }; // Check if the map is among the most popular -if (_worldName in ["chernarus", "bootcamp_acr", "woodland_acr", "utes"]) then { +if (_worldName in ["chernarus", "bootcamp_acr", "woodland_acr", "utes"]) exitWith { // Source: http://www.iten-online.ch/klima/europa/tschechien/prag.htm GVAR(TempDay) = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; GVAR(TempNight) = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; @@ -239,3 +240,17 @@ if (_worldName in ["kunduz"]) exitWith { [0.04, 0.02, 0.05, 0.14, 0.19, 0.07, 0.10, 0.07] // December ]; }; + + +// Catches any "Winter" Map that hasnt been defined otherwise - this should stay at the end of the file +// Values are not based on any RL reference since the snow terrain textures persists regardless the date +_cfgPath = _cfgPath >> "RainParticles"; +if ( + "winter" in _worldName || + {"snow" in getText (_cfgPath >> "rainDropTexture")} || + {getNumber (_cfgPath >> "snow") != 0} +) exitWith { + GVAR(TempDay) = [-10,-9,-8,-7,-6,-5,-6,-7,-8,-9,-10,-11]; + GVAR(TempNight) = [-15,-14,-13,-12,-11,-10,-9,-10,-11,-12,-13,-17]; + GVAR(Humidity) = [82, 80, 81, 82, 83, 82, 81, 82, 83, 82, 83, 82]; +}; diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 55306f4a01..bb815b8d06 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -130,7 +130,7 @@ Megadja az intervallumot (másodpercben) az időjárás-frissítések között Определяет интервал (в секундах) между обновлениями погоды Definisce l'intervallo (in secondi) tra aggiornamenti del meteo - 天候を更新する間隔を定義します。(秒) + 天候を更新する間隔 (秒) を定義します 기후를 갱신하는 간격을 초 단위로 정합니다. 设定天气更新的时间间隔(秒) 設定天氣更新的時間間隔(秒) diff --git a/addons/winddeflection/XEH_postInit.sqf b/addons/winddeflection/XEH_postInit.sqf index fbdfdfc868..a414058349 100644 --- a/addons/winddeflection/XEH_postInit.sqf +++ b/addons/winddeflection/XEH_postInit.sqf @@ -9,12 +9,12 @@ GVAR(trackedBullets) = []; if (!GVAR(enabled)) exitWith {}; // Register fire event handler - ["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; - ["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayer", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; if (GVAR(vehicleEnabled)) then { - ["ace_firedPlayerVehicle", DFUNC(handleFired)] call CBA_fnc_addEventHandler; - ["ace_firedPlayerVehicleNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicle", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicleNonLocal", LINKFUNC(handleFired)] call CBA_fnc_addEventHandler; }; [] call FUNC(updateTrajectoryPFH); diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index e4b547c032..c1b93818f0 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -16,7 +16,7 @@ */ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; -TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); +TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && {_projectile isKindOf "BulletBase" && {_unit isKindOf "Man"}}) exitWith {false}; diff --git a/addons/xm157/functions/fnc_ballistics_getData.sqf b/addons/xm157/functions/fnc_ballistics_getData.sqf index 928936c51e..828db8e4ae 100644 --- a/addons/xm157/functions/fnc_ballistics_getData.sqf +++ b/addons/xm157/functions/fnc_ballistics_getData.sqf @@ -24,7 +24,6 @@ private _key = format ["weaponInfoCache-%1-%2-%3",_weaponClass,_magazineClass,_a private _weaponInfo = GVAR(data) getOrDefault [_key, []]; if ((_weaponInfo isEqualTo []) && {_magazineClass != ""}) then { TRACE_3("new weapon/mag",_weaponClass,_magazineClass,_ammoClass); - private _useABConfig = (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]); private _zeroRange = 100; private _boreHeight = [_unit, 0] call EFUNC(scopes,getBoreHeight); @@ -35,8 +34,14 @@ if ((_weaponInfo isEqualTo []) && {_magazineClass != ""}) then { _weaponConfig params ["_barrelTwist", "_twistDirection", "_barrelLength"]; private _bc = if (_ballisticCoefficients isEqualTo []) then { 0 } else { _ballisticCoefficients # 0 }; + private _useAB = ( + missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && + {missionNamespace getVariable [QEGVAR(advanced_ballistics,barrelLengthInfluenceEnabled), false]} && + {_bc != 0} + ); + // Get Muzzle Velocity - private _muzzleVelocity = if (_barrelLength > 0 && _useABConfig && {_bc != 0}) then { + private _muzzleVelocity = if (_barrelLength > 0 && _useAB) then { [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift) } else { private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "initSpeed"); diff --git a/addons/xm157/functions/fnc_weaponInfo_draw.sqf b/addons/xm157/functions/fnc_weaponInfo_draw.sqf index ef9fd1d528..c03b575f4e 100644 --- a/addons/xm157/functions/fnc_weaponInfo_draw.sqf +++ b/addons/xm157/functions/fnc_weaponInfo_draw.sqf @@ -86,7 +86,7 @@ if (_retTex != ctrlText _ctrlScopeReticle) then { _ctrlScopeReticle ctrlSetText private _rangeInfo = _range call { if (_range == 0) exitWith { "" }; if (_range < 0) exitWith { // range error - blink if recent - if ((_timeSinceLastInput < 3) && {(floor (4*_timeSinceLastInput)) % 2 == 1}) then { "----" } else { "" }; + ["", "----"] select ((_timeSinceLastInput < 3) && {(floor (4*_timeSinceLastInput)) % 2 == 1}); }; format ["%1 m", _range toFixed 0] }; @@ -98,7 +98,7 @@ _ctrl ctrlSetText _rangeInfo; private _bearingInfo = call { private _bearingSetting = GVAR(data) getOrDefault ["bearing_show", 0]; if ((_bearingSetting == 2) && {_timeSinceLastInput > 2}) exitWith { "" }; - if ((_bearingSetting == 1)) exitWith { format ["%1", floor (17.777777 * _weaponDir)]; }; // (6400 Mils, not MRAD) + if ((_bearingSetting == 1)) exitWith { str floor (17.777777 * _weaponDir); }; // (6400 Mils, not MRAD) format ["%1°", floor _weaponDir]; }; private _ctrl = _display displayCtrl IDC_SCREEN_TEXT_UPPER_LEFT; diff --git a/addons/yardage450/XEH_postInit.sqf b/addons/yardage450/XEH_postInit.sqf index 2959360f7d..1f3cb1a1cf 100644 --- a/addons/yardage450/XEH_postInit.sqf +++ b/addons/yardage450/XEH_postInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +if (!hasInterface) exitWith {}; + #include "initKeybinds.inc.sqf" GVAR(active) = false; diff --git a/addons/yardage450/functions/fnc_turnOn.sqf b/addons/yardage450/functions/fnc_turnOn.sqf index e30798c523..62bb135a2c 100644 --- a/addons/yardage450/functions/fnc_turnOn.sqf +++ b/addons/yardage450/functions/fnc_turnOn.sqf @@ -15,12 +15,12 @@ * Public: No */ -#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) +#define DISPLAY_YARDAGE (uiNamespace getVariable "ACE_RscYardage450") +#define CTRL_TARGET (DISPLAY_YARDAGE displayCtrl 720041) +#define CTRL_LASER (DISPLAY_YARDAGE displayCtrl 720042) +#define CTRL_RANGE (DISPLAY_YARDAGE displayCtrl 720043) +#define CTRL_METERS (DISPLAY_YARDAGE displayCtrl 720044) +#define CTRL_YARDS (DISPLAY_YARDAGE displayCtrl 720045) if (currentWeapon ACE_player != "ACE_Yardage450" || cameraView != "GUNNER") exitWith {}; @@ -33,25 +33,28 @@ GVAR(active) = true; [{ if (CBA_missionTime - GVAR(powerOnTime) > 30) exitWith { GVAR(active) = false; - 74210 cutText ["", "PLAIN"]; + QUOTE(ADDON) 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 "---"; + if (isNil {DISPLAY_YARDAGE} || {isNull DISPLAY_YARDAGE} || {ctrlIDD DISPLAY_YARDAGE != -1}) then { + TRACE_1("making display",DISPLAY_YARDAGE); + QUOTE(ADDON) cutRsc ["ACE_RscYardage450", "PLAIN", 1, false]; }; - __ctrlMeters ctrlShow !GVAR(useYards); - __ctrlYards ctrlShow GVAR(useYards); + + CTRL_LASER ctrlShow GVAR(lasing); + if (GVAR(targetAcquired)) then { + CTRL_TARGET ctrlSetText "Target Acquired"; + CTRL_RANGE ctrlSetText GVAR(targetRangeText); + } else { + CTRL_TARGET ctrlSetText ""; + CTRL_RANGE ctrlSetText "---"; + }; + CTRL_METERS ctrlShow !GVAR(useYards); + CTRL_YARDS ctrlShow GVAR(useYards); } else { - 74210 cutText ["", "PLAIN"]; + QUOTE(ADDON) cutText ["", "PLAIN"]; }; }, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 12bd359866..46e95431a1 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -7,12 +7,12 @@ PREP_RECOMPILE_START; PREP_RECOMPILE_END; if (isServer) then { - [QGVAR(zeusUnitAssigned), FUNC(handleZeusUnitAssigned)] call CBA_fnc_addEventHandler; + [QGVAR(zeusUnitAssigned), LINKFUNC(handleZeusUnitAssigned)] call CBA_fnc_addEventHandler; // Only add an InitPost EH if setting is enabled (and apply retroactively) ["CBA_settingsInitialized", { if (GVAR(autoAddObjects)) then { - ["AllVehicles", "InitPost", FUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler; + ["AllVehicles", "InitPost", LINKFUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler; }; }] call CBA_fnc_addEventHandler; }; diff --git a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf index 7378cae65e..8dd5f26929 100644 --- a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf +++ b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf @@ -29,7 +29,7 @@ if (_activated && local _logic) then { case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";}; case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";}; case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";}; - case (vehicle _unit != _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; + case (!isNull objectParent _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";}; }; if (_error == "") then { diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index c597955a23..ec04a12d24 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -257,7 +257,7 @@ if (_activated) then { //--- Player if (hasinterface) then { waituntil {local player}; - _serverCommand = if (_ownerVar == "#adminLogged") then {"#shutdown"} else {"#kick"}; + _serverCommand = ["#kick", "#shutdown"] select (_ownerVar == "#adminLogged"); //--- Black effect until the interface is open _forced = _logic getvariable ["forced",0] > 0; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 135ed538cd..ba30a2eaf4 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -42,7 +42,7 @@ if (_activated) then { _posAmmo = +_pos; _posAmmo set [2,0]; _dir = direction _logic; - _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _simulation = toLowerANSI gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); _altitude = 0; _velocity = []; _attach = false; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index b2288be91c..2aa438be53 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -30,7 +30,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { //--- Get unit under cursor _unit = objnull; _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; - if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; + if ((_mouseOver select 0) == "OBJECT") then {_unit = _mouseOver select 1;}; _unit = effectivecommander _unit; //--- Temp owner diff --git a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf index 615a11d271..dded460710 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf @@ -48,7 +48,7 @@ waitUntil { }; TRACE_2("Finished primary movement",_vehicle distance2D _wpPos,_closeEnoughTicks); -if ((!alive _vehicle) || {!alive _commander}) exitWith {TRACE_2("died",alive _vehicle, alive _commander); true}; +if ((!alive _vehicle) || {!alive _commander}) exitWith {TRACE_2("died",alive _vehicle,alive _commander); true}; if (((getPos _vehicle) select 2) < 25) exitWith {TRACE_1("too low",getPos _vehicle); true}; // Fly level and straight diff --git a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf index 6c511bae07..6d2a94139b 100644 --- a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf +++ b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf @@ -30,7 +30,7 @@ switch (true) do { }; default { - TRACE_1("Calling removeVirtualXXXCargo functions", _object); + TRACE_1("Calling removeVirtualXXXCargo functions",_object); [_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo; [_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo; [_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo; diff --git a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf index 2a013fa4c2..a624b7dded 100644 --- a/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf +++ b/addons/zeus/functions/fnc_moduleSuppressiveFire.sqf @@ -69,7 +69,7 @@ if ([_unit] call EFUNC(common,isPlayer)) exitWith { } else { // Direct fire - Get a target position that will work private _lis = lineIntersectsSurfaces [eyePos _unit, _targetASL, _unit, _vehicle]; - if ((count _lis) > 0) then { // If point is hidden, unit won't fire, do a ray cast to find where they should shoot at + if (_lis isNotEqualTo []) then { // If point is hidden, unit won't fire, do a ray cast to find where they should shoot at _targetASL = ((_lis select 0) select 0); TRACE_1("using ray cast pos",_mousePosASL distance _targetASL); }; diff --git a/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf index 9c34bc8f65..5c9a220615 100644 --- a/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf +++ b/addons/zeus/functions/fnc_ui_toggleFlashlight.sqf @@ -53,7 +53,7 @@ if !(isNull _unit) then { if (isNull _unit) then { (_display displayCtrl 56220) lbDelete 0; } else { - (_display displayCtrl 56218) lbSetCurSel ([0, 1] select (_unit isFlashlightOn currentWeapon _unit)); + (_display displayCtrl 56218) lbSetCurSel (parseNumber (_unit isFlashlightOn currentWeapon _unit)); }; private _fnc_onUnload = { diff --git a/addons/zeus/functions/fnc_ui_toggleNvg.sqf b/addons/zeus/functions/fnc_ui_toggleNvg.sqf index 1e60a777ea..5d5747c7ca 100644 --- a/addons/zeus/functions/fnc_ui_toggleNvg.sqf +++ b/addons/zeus/functions/fnc_ui_toggleNvg.sqf @@ -53,7 +53,7 @@ if !(isNull _unit) then { if (isNull _unit) then { (_display displayCtrl 92856) lbDelete 0; } else { - (_display displayCtrl 92855) lbSetCurSel ([0, 1] select (hmd _unit isNotEqualTo "")); + (_display displayCtrl 92855) lbSetCurSel (parseNumber (hmd _unit isNotEqualTo "")); }; private _fnc_onUnload = { diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index d23a7cf407..8b3aaed92c 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -207,7 +207,7 @@ Feltárja az aknákat a szövetségeseknek, és jelölőket helyez el a térképen. Показывает мины союзникам и отмечает их маркерами на карте. Rivela mine ad alleati e piazza marcatori in mappa. - 友軍に地雷と地図へ設置マーカーを表示します。 + 地雷の位置を味方に公開し、マップマーカーを配置します。 아군에게 지도 상의 모든 지뢰를 표시합니다. 地图将标记队友放置的地雷 地圖將標記隊友放置的地雷 @@ -998,7 +998,7 @@ Einheit muss ein Fahrzeug mit Ladekapazität sein La unidad debe ser un vehículo con espacio de carga L'unité doit être un véhicule muni d'un espace de stockage. - ユニットはカーゴのある車両である必要があります + ユニットは貨物室のある車両である必要があります 대상이 반드시 화물을 실을 수 있는 차량이어야 합니다 单位必须是载具且有载货空间 單位必須是載具且有載貨空間 @@ -1013,7 +1013,7 @@ Einheit muss freie Ladekapazität haben La unidad debe tener espacio de carga disponible L'unité doit avoir de l'espace de chargement disponible. - ユニットのカーゴには空きがありません + ユニットの貨物室に空きが必要です 대상의 화물공간이 남아 있어야 합니다 单位必须有剩余的载货空间 單位必須有剩餘的載貨空間 @@ -1180,7 +1180,7 @@ Cargaison : Груз: Náklad: - カーゴ: + 貨物: Ładunek: Ladung: 화물: @@ -1303,7 +1303,7 @@ Load into Cargo In Frachtraum laden Carica nel carico - カーゴへ積載 + 貨物室へ積載 裝載到貨物中 装载到货物中 화물 싣기 @@ -1318,8 +1318,10 @@ Unload from cargo Aus Frachtraum ausladen Scarica dal carico - カーゴから降ろす + 貨物室から降ろす 화물 내리기 + Выгрузить из отсека + Décharger de la cargaison Toggle NVGs @@ -1901,7 +1903,7 @@ Paradrop Cargo Ladung abwerfen (Fallschirm) - カーゴを空中投下 + 貨物を空中投下 Zrzut ładunku (cargo) Десантировать груз Soltar carga de paraquedas @@ -1917,7 +1919,7 @@ No cargo loaded Keine Ladung geladen - カーゴは積載されていません + 貨物は積載されていません Niczego nie załadowano do cargo Грузовой отсек пуст Nenhuma carga carregada @@ -1964,6 +1966,8 @@ Il Menù Medico è disabilitato 医療メニューは無効になっています 의료 메뉴가 비활성화되었습니다 + Медицинское меню отключено + Le Menu médical est désactivé Lay Trenchline @@ -1973,6 +1977,7 @@ Grabenlinie legen Piazza Trincea 塹壕溝線を敷設 + Проложить траншею +SHIFT to force (Can only lay N/S or E/W) @@ -1982,6 +1987,7 @@ +SHIFT zum Erzwingen (Kann nur nach N/S oder E/W legen) +SHIFT per forzare (Può piazzare solo N/S o E/O +SHIFTキー で強制的に敷設 (北/南または東/西方向にのみ配置可能) + +SHIFT на принудительное (может укладываться только на Север/Юг или Восток/Запад) diff --git a/docs/_config.yml b/docs/_config.yml index 52ba8da828..66cd1141f7 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -8,9 +8,9 @@ ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 16 - patch: 1 - build: 74 + minor: 17 + patch: 0 + build: 82 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 67de48f2f6..e3c042e9c7 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -8,9 +8,9 @@ ace: githubUrl: https://github.com/acemod/ACE3 version: major: 3 - minor: 16 - patch: 1 - build: 74 + minor: 17 + patch: 0 + build: 82 markdown: kramdown diff --git a/docs/_includes/_footer.html b/docs/_includes/_footer.html index ec55355d99..b13d9d47b5 100644 --- a/docs/_includes/_footer.html +++ b/docs/_includes/_footer.html @@ -36,6 +36,12 @@ +
+

+ ACE3 is free and open-source software. +
+ acemod +

diff --git a/docs/_includes/_header.html b/docs/_includes/_header.html index 7123c5968a..8c6cd8c39e 100644 --- a/docs/_includes/_header.html +++ b/docs/_includes/_header.html @@ -27,6 +27,7 @@ + diff --git a/docs/_posts/2024-04-01-ace3-version3170.md b/docs/_posts/2024-04-01-ace3-version3170.md new file mode 100644 index 0000000000..fddc71642a --- /dev/null +++ b/docs/_posts/2024-04-01-ace3-version3170.md @@ -0,0 +1,48 @@ +--- +title: ACEREP #00012 +description: Status report on ACE3 version 3.17.0 +parent: posts +image: +author: Jonpas +layout: post +--- + +This post accompanies the release of ACE3 v3.17.0, a smaller but not any less significant release. We will also take a peek at at our new experimental project. + + + +### Release Cadence + +With improved tooling such as [HEMTT](https://github.com/BrettMayson/HEMTT) simplifying our release processes, we have been aiming aiming to do releases more often than in the past. This is one of the first bigger releases following the set cadence. + +While releases are expected to be smaller as less time passes between them resulting in fewer changes, the new cadence should effectively contribute to higher quality and stability of ACE3 overall. + +We are maintaining our philosophy of "no schedule, no ETAs" and simply release when the team is able to and opts to do so. Work done on the project should not affect this and we aim to release more often even if there are only little or insignificant changes. + +### Integrated CUP Compatibility + +[Community Upgrade Project](https://www.cup-arma3.org/) has always provided compatibility and support for ACE3. Originally it has been hosted and maintained by the CUP Team. With the availability of automatically loading a compatibility patch if the given mod is loaded, we have worked together with the CUP Team to bring ACE3 Compatibility for CUP directly into the ACE3 mod. + +**This means you should remove any compatibility patches provided by CUP** and instead simply use ACE3 together with CUP. In addition to integrated compatibility, some additional improvements were also made. + +### ACE Anvil + +
+
+ ACE Anvil Logo +
+
+ +[ACE Anvil](https://github.com/acemod/ACE-Anvil) is an **experimental** realism mod for Arma Reforger, the first Arma game running on the Enfusion engine. + +Anvil is not expected to reach feature parity with ACE3. It is heavily experimental and we invite you to contribute to it. As Arma Reforger is a test platform, go wild, we are happy to add any realism or quality of life features, even some that might not be strictly within ACE's usual scope. + +Learn more about ACE Anvil at the [Anvil Documentation](https://anvil.acemod.org/)! + +### The End Things + +The change log for ACE3 v3.17.0 can be found [here](https://github.com/acemod/ACE3/releases/v3.17.0){:target="_blank"}. + +We are still in need for translations for some languages within the ACE3 project. Please have a look at [this GitHub issue to track the progress and what languages lack translations](https://github.com/acemod/ACE3/issues/367){:target="_blank"}. Any and all help with this is very appreciated. + +Make sure to [follow us on Twitter](https://twitter.com/intent/follow?screen_name=ace3mod&tw_p=followbutton){:target="_blank"} and to [like our Facebook page](https://www.facebook.com/ACE3Mod/){:target="_blank"}. diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml index ca25a38c0a..5645a80000 100644 --- a/docs/docker-compose.yml +++ b/docs/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.2" - services: docs: container_name: ace3mod_jekyll diff --git a/docs/img/news/240401_ace_anvil_logo.webp b/docs/img/news/240401_ace_anvil_logo.webp new file mode 100644 index 0000000000..8a679e7a59 Binary files /dev/null and b/docs/img/news/240401_ace_anvil_logo.webp differ diff --git a/docs/img/wiki/feature/atragmx1.webp b/docs/img/wiki/feature/atragmx1.webp deleted file mode 100644 index 809f44a6c0..0000000000 Binary files a/docs/img/wiki/feature/atragmx1.webp and /dev/null differ diff --git a/docs/img/wiki/feature/atragmx1ab.webp b/docs/img/wiki/feature/atragmx1ab.webp new file mode 100644 index 0000000000..7a71559f24 Binary files /dev/null and b/docs/img/wiki/feature/atragmx1ab.webp differ diff --git a/docs/img/wiki/feature/atragmx1db.webp b/docs/img/wiki/feature/atragmx1db.webp new file mode 100644 index 0000000000..0bf6bc71f7 Binary files /dev/null and b/docs/img/wiki/feature/atragmx1db.webp differ diff --git a/docs/index.html b/docs/index.html index 1b830ece20..c15d788798 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ sitemap: exclude: "yes" --- -Fork me on GitHub +Fork me on GitHub
diff --git a/docs/team.md b/docs/team.md index f8fe165bf9..d5d9d03bfa 100644 --- a/docs/team.md +++ b/docs/team.md @@ -11,6 +11,8 @@ This page lists all current maintainers for the ACE3 projects with their areas o This lists all the maintainers responsible for project management and the overall direction of the ACE3 project. +- [BaerMitUmlaut](https://github.com/BaerMitUmlaut){:target="_blank"} + - Scripting, Config - [bux](https://github.com/bux){:target="_blank"} - Scripting, Testing - [Felix Wiegand](https://github.com/koffeinflummi){:target="_blank"} @@ -23,13 +25,13 @@ This lists all the maintainers responsible for project management and the overal - Coding, Modeling, Performance, SME - [PabstMirror](https://github.com/PabstMirror){:target="_blank"} - Scripting, Config +- [veteran29](https://github.com/veteran29){:target="_blank"} + - Scripting, Config - [ViperMaul](https://github.com/vipermaul){:target="_blank"} - Project management ## Core Maintainers -- [BaerMitUmlaut](https://github.com/BaerMitUmlaut){:target="_blank"} - - Scripting, Config - [commy2](https://github.com/commy2){:target="_blank"} - Scripting, Config - [esteldunedain](https://github.com/esteldunedain){:target="_blank"} @@ -58,18 +60,19 @@ This lists all the maintainers responsible for project management and the overal - gundy - Janus - [johnb43](https://github.com/johnb432){:target="_blank"} +- [Kex](https://github.com/kexanone){:target="_blank"} - [Kieran](https://github.com/kieran-s){:target="_blank"} - [mharis001](https://github.com/mharis001){:target="_blank"} - [tcvm](https://github.com/TheCandianVendingMachine){:target="_blank"} - [TheMagnetar](https://github.com/TheMagnetar){:target="_blank"} - Scripting - tpM -- [veteran29](https://github.com/veteran29){:target="_blank"} ## Moderators - [drofseh](https://github.com/Drofseh){:target="_blank"} - [MikeMF](https://github.com/Mike-MF){:target="_blank"} +- [MiszczuZPolski](https://github.com/MiszczuZPolski){:target="_blank"} ## Contributors diff --git a/docs/tools/document_functions.py b/docs/tools/document_functions.py index c3286cf6ef..dab567d208 100644 --- a/docs/tools/document_functions.py +++ b/docs/tools/document_functions.py @@ -192,6 +192,9 @@ class FunctionFile: if arg_default is None: arg_default = "" + if ("SCALAR" in arg_types or "NUMVER" in arg_types): + self.feedback("Bad Arg Type \"{}\"".format(arg_types), 1) + arguments.append([arg_index, arg_name, arg_types, arg_default, arg_notes]) else: # Notes about the above argument won't start with an index diff --git a/docs/wiki/development/arma-3-scheduler-and-our-practices.md b/docs/wiki/development/arma-3-scheduler-and-our-practices.md index 440f0f9557..d2ffda2a07 100644 --- a/docs/wiki/development/arma-3-scheduler-and-our-practices.md +++ b/docs/wiki/development/arma-3-scheduler-and-our-practices.md @@ -36,7 +36,7 @@ Code running in the unscheduled environment uses linear execution, that means it ## 2. What is the scheduler and why do I care? -The Arma 3 script scheduler basically gives a fair-share execution to all running scripts, FSMs, and SQS files running on any given client or server at any given time. See the [Biki article](https://community.bistudio.com/wiki/Biki2.0:Performance_Considerations){:target="_blank"} for a in-depth explanation of this. What this basically means though, is that all scripts get a fair share; this also means scheduled execution is drastically affected by other mods that use scheduled execution. For example, if 2 different spawn's are running in a tight loop of `while {true} do {...};`, they will both get exactly 50% of the scheduling time. +The Arma 3 script scheduler basically gives a fair-share execution to all running scripts, FSMs, and SQS files running on any given client or server at any given time. See the [Biki article](https://community.bistudio.com/wiki/Biki2.0:Performance_Considerations){:target="_blank"} for an in-depth explanation of this. What this basically means though, is that all scripts get a fair share; this also means scheduled execution is drastically affected by other mods that use scheduled execution. For example, if 2 different spawn's are running in a tight loop of `while {true} do {...};`, they will both get exactly 50% of the scheduling time. With the way mission makers and mod makers generally use `spawn`/`execVM`, this means you're actually getting drastically less execution time in the scheduled environment than you might think. This leads to visible delay issues all the way up to massive delay on execution. You can easily test and prove this by looping spawns and watching the execution times extend. diff --git a/docs/wiki/feature/atragmx.md b/docs/wiki/feature/atragmx.md index 2f778f222a..7a3b54d64e 100644 --- a/docs/wiki/feature/atragmx.md +++ b/docs/wiki/feature/atragmx.md @@ -22,7 +22,7 @@ Horus ATragMX software considers atmospheric conditions, gun data, ammunition, r ## 2. Requirement -- [Advanced Ballistics module enabled]({{ site.baseurl }}/wiki/feature/advanced-ballistics.html) +- [Advanced Ballistics enabled]({{ site.baseurl }}/wiki/feature/advanced-ballistics.html) ## 3. Usage @@ -31,9 +31,9 @@ Horus ATragMX software considers atmospheric conditions, gun data, ammunition, r #### 3.1.1 Interaction Menu -- Open the self interaction menu Ctrl + ⊞ Win -- Select `Equipment` -- Select `Open AtragMx` +- Open the self interaction menu Ctrl + ⊞ Win. +- Select `Equipment`. +- Select `Open AtragMx`. #### 3.1.2 Custom key @@ -43,43 +43,66 @@ Horus ATragMX software considers atmospheric conditions, gun data, ammunition, r **Start of the mission:** -- Open the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and check the cartridge, the zeroed distance, the rifle twist, the muzzle velocity at 15°C and the bore height. +- Open the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and check the ammunition: bullet diameter, bullet weight, rifle twist, muzzle velocity at 15°C, zeroed distance and bore height. -Range card +Range card -- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=15) -- `Open Gun` the 7.62x51mm M80 in the `GunList`. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=25) -- Select `E` (English unit) at the top right. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=10) -- Open the `Gun` column, check and update the `Bore`, the `Rifle Twist` and `Done`. +- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. +- `Open Gun` the 7.62x51mm M80 in the `GunList`. +- Select `E` (English unit) at the top right. +- Open the `Gun` column, check and update the `Bore (inches)`, `Bullet Weight (grains)`, `Bullet Diam (inches)`, `Rifle Twist (in/trn)` and `Done`. - Select `M` (Metric unit) at the top right. -- Open the `Gun` column, check and update the `Muzzle Velocity`, the `Zero Range` and `Done`. -- *The Muzzle Velocity Table will be automatically updated.* [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=22) -- *(Must be edited manually for specific cartridges according with the range card)* +- Open the `Gun` column, check and update the `Muzzle Velocity (m/s)`, the `Zero Range (meters)` and `Done`. +- *Muzzle Velocities (`Options` / `Muz Vel table`) may need a manual update according to the range card.* +- *AtragMx is configured with `C1 coefficient` according to vanilla weapons and its ammunitions in `GunList`.* +- *More information about C1: [Example with `Add New Gun` in `GunList`](#35-example-with-add-new-gun-in-gunlist).* +- Check `Elev` = 0 with `ZR` = `TR` *(if not, open `Gun` column and `Done`)*. - Optionally, `Save Gun` and `Done` in the `GunList`. - + **In position:** -- Update the `Atmsphr` column with the [Kestrel 4500]({{ site.baseurl }}/wiki/feature/kestrel4500.html) and `Done`. +- Update the `Atmsphr` column and `Done`. Requirement: [Kestrel 4500]({{ site.baseurl }}/wiki/feature/kestrel4500.html). - *Check the new `Muzzle Velocity` in the `Gun` column.* -- Update the `Target` column (the [wind arrow]({{ site.baseurl }}/wiki/feature/weather.html) will also help). [[1]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=16) [[2]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=30) [[3]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=32) [[4]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=33) -- *The latitude for all common maps can be found in the [ACE3 Github]({{ site.ace.githubUrl }}/blob/master/addons/common/functions/fnc_getMapData.sqf).* -- Apply the vertical and horizontal elevations on the [scope]({{ site.baseurl }}/wiki/feature/scopes.html). -- Control the breath and press. - +- Update the `Target` column and `Done`. Requirement: [Wind arrow]({{ site.baseurl }}/wiki/feature/weather.html), [Protractor]({{ site.baseurl }}/wiki/feature/advanced-ballistics#22-protractor), [Map Tools]({{ site.baseurl }}/wiki/feature/maptools.html). For advanced tools: [ACE3 Equipment]({{ site.baseurl }}/wiki/feature.html). + - `Latitude`: *[ACE3 Github]({{ site.ace.githubUrl }}/blob/master/addons/common/functions/fnc_getMapData.sqf) or Eden Editor's Extended Debug Console: Watch:* `ace_common_maplatitude`. + - `Dir of Fire (deg from N)`: *The value is therefore given as the direction of the barrel axis from true north.* [Horus manual p.14] + - `Wind speed (m/s)`: *Two wind speed values (low and high) may be entered on the target screen,[...] Lead/Wind2 button on the screen.* [Horus manual p.32] + - Wind takes into account geographic location, season, time of day, obstacles, altitude and surface roughness: [Wind Profile](https://wind-data.ch/tools/profile.php?lng=en). + - `Wind Direction (clock)`: *Wind Direction is expressed in clock points.[...], wind is always described in terms of where it is coming from.* [Horus manual p.16] + - `Inclination Angle`: *The degrees field is marked with a “d” and the cosine field with a “c”.* [Horus manual p.33] + - `Target Speed`: *Target Speed Assist* [Horus manual p.21] + - `Target Range (meters)`: *Parameter Limits minimum and maximum values: 25 - 3700 meters.* [Horus manual p.17] +- Apply vertical (Page Up and Down keys as default) and horizontal (Left Ctrl + Page Up and Down keys as default) elevations to the [scope]({{ site.baseurl }}/wiki/feature/scopes.html). +- Hold Breath (Left Shift as default) and Fire (Prim. Mouse. Btn. as default). + ### 3.3 Example with Truing tool -- Open the `Truing Drop` in the `Options` menu. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=23) -- Add the actual `Target Range` in the `SUPER` column and `Calc`. -- Add the same `Target Range` in the `SUB` column and `Calc`. -- Apply the actual scope elevation in the `Drop` field and `Calc`. -- `Accept` the new `C1`, `Gun` column and `Elev` are updated. -- *The Drag Coefficient Table will be automatically updated.* [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=22) -- Optionally, `Save Gun` and `Done` in the `GunList`. - +> This process is called “Truing Drop”, or simply “Truing”. It involves taking 2 or 3 real flight data points (finding bullet drop at 2 or 3 places along its flight) and feeding it into the calculation parameters. [Horus manual p.23] + +> The Truing Drop function is opened from ATrag’s main screen by selecting “Options” [...], then selecting “Truing Drop” from the menu that appears. [Horus manual p.23] + +> With C1, you can also insert the new BC into the C1 table (with the target range value), or you can replace the C1 table with the following values: +> 1. first entry: Zero Range, original C1. +> 2. second entry: range at 75% of distance between transonic start and subsonic start, with original C1. +> 3. third entry: range 200 (y/m) beyond subsonic start, with new calculated C1. [Horus manual p.24] + +- Basic example with ammunition 7.62x51mm G7 ballistic coefficient. + - Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. + - `Open Gun` a custom profile in the `GunList`. + - *More information about custom profile: [Example with `Add New Gun` in `GunList`](#35-example-with-add-new-gun-in-gunlist).* + - Check `Elev` = 0 with `ZR` = `TR` *(if not, open `Gun` column and `Done`)*. + - Open the `Truing Drop` in the `Options` menu. + - Add the actual `Target Range` in the `SUPER` column and `Calc`. + - Add the same `Target Range` in the `SUB` column and `Calc`. + - Apply the actual scope elevation in the `Drop` field and `Calc`. + - `Accept` the new `C1`, `Gun` column and `Elev` are updated. + - *C1 Ballistic Coefficient vs. Distance Interpolation Table (`Options` / `Drag Coef Table`) will be updated.* + - Optionally, `Save Gun` and `Done` in the `GunList`. + Calculation - -- If a new `Target Range` is applied in the `Target` column, the ballistic coefficient `C1` and the elevation `Elev` will be automatically recalculated. - + +- If a new `Target Range` is applied in the `Target` column, the ballistic coefficient `C1` and the elevation `Elev` will be recalculated. + Interpolation Extrapolation @@ -87,23 +110,26 @@ Horus ATragMX software considers atmospheric conditions, gun data, ammunition, r ### 3.4 Example with overwritten zero distance - The `Default zero distance` can be overwritten with the [Scopes Options]({{ site.baseurl }}/wiki/feature/scopes.html), the [Scopes Framework]({{ site.baseurl }}/wiki/framework/scopes-framework.html) or the [CBA Settings System](https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System). -- In this case, the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) will be automatically updated, NOT the AtragMx. -- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=15) +- In this case, the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) will be updated, **NOT the AtragMx**. +- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. - Open the `Gun` column, check and update the `Zero Range` and `Done`. - +- Check `Elev` = 0 with `ZR` = `TR` *(if not, open `Gun` column and `Done`)*. +- Optionally, `Save Gun` and `Done` in the `GunList`. + Zero distance 300m ### 3.5 Example with `Add New Gun` in `GunList` -- Open the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and check the bullet diameter, the bullet weight, the **(bullet Class Name)** and the muzzle velocities. -- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=15) -- Select `Add New Gun` in the `GunList`. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=25) +- Open the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and check the ammunition: **bullet Class Name**, bullet diameter, bullet weight, rifle twist, muzzle velocities, zeroed distance and bore height. +- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. +- Select `Add New Gun` in the `GunList`. - Add a `New Gun Name` and `Open Gun`. -- Select `E` (English unit) at the top right. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=10) -- Open the `Gun` column, check and update the `Bullet Weight (grains)`, the `Bullet Diam (inches)` and `Done`. +- Select `E` (English unit) at the top right. +- Open the `Gun` column, check and update the `Bore (inches)`, `Bullet Weight (grains)`, `Bullet Diam (inches)`, `Rifle Twist (in/trn)` and `Done`. - Select `M` (Metric unit) at the top right. -- Open the `Muz Vel Table` in the `Options` menu or click on `MV` in the `Gun` column. -- Edit manually the `Muzzle Velocity Table` according with the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and `Done`. [[Manual]](https://horusvision.com/download/manual_Horus_ATrag-v385.pdf#page=22) +- Open the `Gun` column, check and update the `Zero Range (meters)` and `Done`. +- Open the `Muz Vel Table` in the `Options` menu or click on `MV` in the `Gun` column. +- Edit manually the `Muzzle Velocity Table` according to the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and `Done`. - The `C1 coefficient` of the bullet can be found with the Eden Editor `Config Viewer`: > configfile >> "CfgAmmo" >> "**bullet Class Name**" >> "ACE_ballisticCoefficients" @@ -112,26 +138,92 @@ Horus ATragMX software considers atmospheric conditions, gun data, ammunition, r - *The AtragMx accepts only **G1 ballistic coefficient**.* - *G7 ballistic coefficient can be converted, for example, with the online [JBM Ballistics Calculators](http://www.jbmballistics.com/cgi-bin/jbmgf-5.1.cgi)*. +- Check `Elev` = 0 with `ZR` = `TR` *(if not, open `Gun` column and `Done`)*. - Optionally, `Save Gun` and `Done` in the `GunList`. +> Note: The ballistic coefficient can be calculated by using the [360 Degree Training Course mission](#5-resources) as a chronograph at different distances and [JBM Ballistics Calculators](http://www.jbmballistics.com/cgi-bin/jbmbcv-5.1.cgi) for example, an another ballistic software at your own convenience, or the [AtragMx Truing Tool](#33-example-with-truing-tool). -> Note: The ballistic coefficient can be calculated by using the [360 Degree Training Course mission](https://forums.bistudio.com/forums/topic/171228-sp-360-degree-training-course/) as a chronograph at different distances and [JBM Ballistics Calculators](http://www.jbmballistics.com/cgi-bin/jbmbcv-5.1.cgi) for example, an another ballistic software at your own convenience, or the [AtragMx Truing Tool](#33-example-with-truing-tool). - -> Example direct conversion with .408 Cheytac 305 grains G7 BC 0.279 at 2000 meters 15°C: +> Example direct conversion with .408 Cheytac 305 grains, G7 BC 0.279 at 2000 meters, ICAO conditions (15°C, 1013.25hPa, 0%): Conversion G7/G1 BC -### 3.6 Adding ATragMX Presets +### 3.6 Connecting AtragMx with Vector 21 and DAGR -- [ATragMX Framework]({{ site.baseurl }}/wiki/framework/atragmx.html) +- Requirement: [Vector]({{ site.baseurl }}/wiki/feature/vector.html) and [DAGR]({{ site.baseurl }}/wiki/feature/dagr.html). +- Open the self interaction menu Ctrl + ⊞ Win. +- Select `Equipment`. +- Select `Configure DAGR` and `CONNECT TO` (DOWN and HELP/SEL) `Vector 21`(HELP/SEL). +- Equip and use the Vector (B key as default). +- Check target's [slope distance and azimuth]({{ site.baseurl }}/wiki/feature/vector#23-slope-distance-and-azimuth) (hold both R and Tab keys as default). +- Open the [AtragMx properly configured before](#32-example-with-m14-and-default-762mm-20rnd-mag) according to current rifle and ammunition. +- Open the `Target` column: `Dir of Fire (deg from N)`, `Inclination Angle` and `Target Range (meters)` updated with Vector's values. -### 3.7 Reseting the AtragMx `GunList` +### 3.7 Adding AtragMx Presets -- Open the Eden Editor and the Extended Debug Console (Ctrl+D). -- Execute `call ace_atragmx_fnc_clear_user_data` (LOCAL EXEC). +- [AtragMx Framework]({{ site.baseurl }}/wiki/framework/atragmx.html) + +> Scope Base Angle value: +> - Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. +> - `Open Gun` the custom profile (with an arbitrary scope base angle) in the `GunList`. +> - Check `Elev` value with `ZR` = `TR`. +> - Open the `Gun` column and `Done`. +> - Execute `copyToClipboard Str(ace_atragmx_workingMemory select 3);` [LOCAL EXEC] with the Eden Editor's Extended Debug Console. +> - Paste new value to the `preset`. +> - After new test, check `Elev` = 0 with `ZR` = `TR`. + +### 3.7 Reseting AtragMx `GunList` + +- Open the Eden Editor's Extended Debug Console. +- Execute `call ace_atragmx_fnc_clear_user_data` or `call ace_atragmx_fnc_initGunList` [LOCAL EXEC], (`RESTART` eventually needed). - The original ACE3 `GunList` will be restored (all `Add New Gun` entries deleted). +### 3.8 Example with AtragMx and default ballistic (M14, 7.62mm 20Rnd Mag) + +> Note: ACE3 has two external ballistics, the vanilla default ballistic (enabled as default) and the [Advanced Ballistics]({{ site.baseurl }}/wiki/feature/advanced-ballistics.html) (must be enabled). The ACE3 default ballistic doesn't take atmospheric conditions (except wind), powder temperature, rifle twist and Earth effects into account. The AtragMx will need for `Gun` column: `Bore`, `C1 Coefficient`, `Muzzle Velocity` and `Zero Range`. With `Target` column, `Latitude` and `Dir of Fire` are useless. `Atmsphr` column must not be updated. + +**Start of the mission:** + +- Open the [Range Card]({{ site.baseurl }}/wiki/feature/rangecard.html) and check the ammunition: **bullet Class Name**, muzzle velocity, zeroed distance and bore height. + +Range card + +- Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. +- Select `E` (English unit) at the top right. +- Open the `Gun` column, check and update the `Bore (inches)` and `Done`. +- Select `M` (Metric unit) at the top right. +- Open the `Gun` column, check and update the `Muzzle Velocity (m/s)`, the `Zero Range (meters)` and `Done`. +- `C1 coefficient` of the bullet = `airFriction x -1000`. +- `airFriction` can be found with the Eden Editor `Config Viewer`: + +> configfile >> "CfgAmmo" >> "**bullet Class Name**" >> "airFriction" + +- *AtragMx is configured with `C1 coefficient` according to vanilla weapons and its ammunitions in `GunList`.* +- *Spin drift and Earth effects not taken into account, `Options` / `Show Coriolis` can be disabled.* +- Check `Elev` = 0 with `ZR` = `TR` *(if not, open `Gun` column and `Done`)*. +- Optionally, `Save Gun` and `Done` in the `GunList`. + +**In position:** + +- **Do not update the `Atmsphr` column.** Default ballistic doesn't take into account temperature, pressure and humidity. +- Update the `Target` column and `Done`. Requirement: [Wind arrow]({{ site.baseurl }}/wiki/feature/weather.html), [Protractor]({{ site.baseurl }}/wiki/feature/advanced-ballistics#22-protractor), [Map Tools]({{ site.baseurl }}/wiki/feature/maptools.html). For advanced tools: [ACE3 Equipment]({{ site.baseurl }}/wiki/feature.html). + - `Wind speed (m/s)`: *Two wind speed values (low and high) may be entered on the target screen,[...] Lead/Wind2 button on the screen.* [Horus manual p.32] + - Wind takes into account geographic location, season, time of day and obstacles. + - `Wind Direction (clock)`: *Wind Direction is expressed in clock points.[...], wind is always described in terms of where it is coming from.* [Horus manual p.16] + - `Inclination Angle`: *The degrees field is marked with a “d” and the cosine field with a “c”.* [Horus manual p.33] + - `Target Speed`: *Target Speed Assist* [Horus manual p.21] + - `Target Range (meters)`: *Parameter Limits minimum and maximum values: 25 - 3700 meters.* [Horus manual p.17] +- Apply vertical (Page Up and Down keys as default) and horizontal (Left Ctrl + Page Up and Down keys as default) elevations to the [scope]({{ site.baseurl }}/wiki/feature/scopes.html). +- Hold Breath (Left Shift as default) and Fire (Prim. Mouse. Btn. as default). + ## 4. Official References -- [Official Manual]({{ site.ace.githubUrl }}/blob/master/extras/manual_Horus_ATrag-v385.pdf) +- [Horus AtragMx Manual]({{ site.ace.githubUrl }}/blob/master/extras/manual_Horus_ATrag-v385.pdf) + + +## 5. Resources + +Missions by Ruthberg, author of Advanced Ballistics and its tools: + +- Arma3 Missions folder: [360 Degree Training Course v1.3]({{ site.ace.githubUrl }}/blob/master/extras/ruthberg_missions/360_Degree_Training_Course-Missions.zip), *[Features](https://forums.bistudio.com/forums/topic/171228-sp-360-degree-training-course/)* +- Eden Editor mission: [360 Degree Training Course Framework]({{ site.ace.githubUrl }}/blob/master/extras/ruthberg_missions/360_Degree_Training_Course-Framework.zip) diff --git a/docs/wiki/feature/explosives.md b/docs/wiki/feature/explosives.md index ec20c0f62f..ec14c4466a 100644 --- a/docs/wiki/feature/explosives.md +++ b/docs/wiki/feature/explosives.md @@ -35,6 +35,7 @@ Enables attaching explosives to vehicles. - 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. +- Alternatively, use Ctrl+Alt+C (ACE3 default key bind `Detonate All on Active Clacker`) to detonate all explosives tied to the `Active Detonator`, which can be changed via the `Set Active Detonator` interaction on the desired Clacker / Dead Man Switch. ### 2.3 Defusing explosives - A `Defusal Kit` is required. diff --git a/docs/wiki/feature/maptools.md b/docs/wiki/feature/maptools.md index c6f4903780..f8ce7e5416 100644 --- a/docs/wiki/feature/maptools.md +++ b/docs/wiki/feature/maptools.md @@ -21,8 +21,11 @@ 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` item in your inventory for this.) +### 1.3 Plotting Board +This adds a plotting board that can be used to aid in the rapid usage and adjustment of short-ranged indirect fires, as well as quick measurements of directions and distances between points, and general land-navigation. + +### 1.4 GPS on map +If you have GPS capability, a GPS display will be shown on the map, indicating current grid position. (You don't need the `Map Tools` item in your inventory for this.) ## 2. Usage @@ -39,3 +42,16 @@ If you are equipped with a vanilla GPS it will be shown on the map. (You don't n - 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). + +### 2.3 Using the plotting board +- To use map tools the `Plotting Board` item is required. +- 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 `Show Plotting Board`. +- Note that you can drag the Plotting Board around with LMB and rotate the different parts of the Plotting Board, each independently from each other, with Ctrl + LMB. +- When a new marker (Local or Group Channel) is created on the inner circle of the Plotting board, the marker will move accordingly when the Plotting Board gets moved or rotated. + +### 2.4 Drawing lines +- You can draw lines on the plotting board. +- These lines are removed from the map once the plotting board is hidden, but they restored when the plotting board is shown again. +- These lines are moved along with the plotting board when the plotting board is dragged. diff --git a/docs/wiki/framework/arsenal-framework.md b/docs/wiki/framework/arsenal-framework.md index 95c7e82211..954bbc0a7e 100644 --- a/docs/wiki/framework/arsenal-framework.md +++ b/docs/wiki/framework/arsenal-framework.md @@ -31,11 +31,11 @@ To quickly add a full ACE Arsenal to a box for all clients use the following cod `ace_arsenal_fnc_initBox` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Box | Object | Required -1 | Items | Array of strings or boolean | Required -2 | Initialize globally | Boolean | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Box | Object | Required | +| 1 | Items | Array of strings or boolean | Required | +| 2 | Initialize globally | Boolean | Optional (default: `false`) | This will add the virtual items passed as arguments and add an ACE interaction to open ACE Arsenal. @@ -51,11 +51,11 @@ Please note that at least one virtual item needs to be added otherwise ACE Arsen `ace_arsenal_fnc_openBox` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Box | Object | Required -1 | Unit to open ACE Arsenal on | Object | Required -2 | Ignore virtual items and fill ACE Arsenal | Boolean | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Box | Object | Required | +| 1 | Unit to open ACE Arsenal on | Object | Required | +| 2 | Ignore virtual items and fill ACE Arsenal | Boolean | Optional (default: `false`) | Examples: - `[_box, player] call ace_arsenal_fnc_openBox` @@ -67,10 +67,10 @@ In the second example a full ACE Arsenal will be opened on the player. `ace_arsenal_fnc_removeBox` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Box | Object | Required -2 | Remove globally | Boolean | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Box | Object | Required | +| 2 | Remove globally | Boolean | Optional (default: `false`) | Example: `[_box, true] call ace_arsenal_fnc_removeBox` @@ -81,11 +81,11 @@ Example: `ace_arsenal_fnc_addVirtualItems` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Box | Object | Required -1 | Items | Array of strings or boolean | Required -2 | Add globally | Boolean | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Box | Object | Required | +| 1 | Items | Array of strings or boolean | Required | +| 2 | Add globally | Boolean | Optional (default: `false`) | Passing an array of strings (class names) will add each one of those items to the specified box, passing true will add ALL items that are compatible with ACE Arsenal (the sorting is done on game startup). Faces, voices and insignia can't be added via this function. @@ -97,11 +97,11 @@ Examples: `ace_arsenal_fnc_removeVirtualItems` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Box | Object | Required -1 | Items | Array of strings or boolean | Required -2 | Remove globally | Boolean | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Box | Object | Required | +| 1 | Items | Array of strings or boolean | Required | +| 2 | Remove globally | Boolean | Optional (default: `false`) | Like adding virtual items, passing an array of string (class names) will remove each ones of those items, however passing true will remove all virtual items and also remove the interaction to access ACE Arsenal. Faces, voices and insignia can't be removed via this function. @@ -136,8 +136,9 @@ Examples: ACE Arsenal uses 2 existing config entries to sort and display items. -- `baseWeapon`: Class name that is used to display an item in the arsenal. This property can be applied to any weapon or weapon attachment in `CfgWeapons`. +- `baseWeapon`: Class name that is used to display an item in the arsenal, used for weapon/attachment variants that are not normally shown to the player (AI variants, PIP optics, and so on). This property can be applied to any weapon or weapon attachment in `CfgWeapons`. Items using CBA or RHS' Scripted Optics systems, or CBA Switchable Attachments do not need this property explictly set, and will automatically use their player-accessible class. - `ACE_isUnique`: Classes in `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Misc. Items. Used for items with attached data that needs to be kept track of, such as Notepads or Spare Barrels. +- `ACE_asItem`: Classes in `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Items. Used for magazines that are not meant to be used in a weapon, such as Painkillers. ### 3.2 New config entries @@ -159,7 +160,7 @@ ACE Medical Treatment and ACE Field Rations also add their own sub-categories, i - `ACE_isMedicalItem`: Items with this property set to `1` will be sorted to the ACE Medical Tab. - `ACE_isFieldRationItem`: Items with this property set to `1` will be sorted to the ACE Field Rations Tab. -Only Misc. Items will be checked for these properties. Magazines must have ACE_isUnique property. +Only Misc. Items will be checked for these properties. Magazines must have `ACE_isUnique` or `ACE_asItem` property. ## 4. Default loadouts @@ -184,11 +185,11 @@ Players with Zeus access can save default loadouts ingame, doing so will make th `ace_arsenal_fnc_addDefaultLoadout` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Name of loadout | String | Required -1 | getUnitLoadout array or CBA extended loadout array | Array | Required -2 | Add loadout globally | Boolean | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Name of loadout | String | Required | +| 1 | getUnitLoadout array or CBA extended loadout array | Array | Required | +| 2 | Add loadout globally | Boolean | Optional (default: `false`) | Example: `["Squad Leader", getUnitLoadout sql1, true] call ace_arsenal_fnc_addDefaultLoadout` @@ -228,22 +229,22 @@ The arguments passed to the bar, text and condition statements are: `ace_arsenal_fnc_addStat` -| | Argument | Type | Optional (default value) ---- | -------- | ---- | ------------------------ -0 | Tabs to add the stat to | Array of arrays | Required -0.1 | Left tab indexes | Array of numbers | Required -0.2 | Right tab indexes | Array of numbers | Required -1 | Stat class ID | String | Required -2 | Config entries to pass | Array of strings | Required -3 | Title | String | Required -4 | Show bar / show text bools | Array of booleans | Required -4.1 | Show bar | Boolean | Required -4.2 | Show text | Boolean | Required -5 | Array of statements | Array of code | Required -5.1 | Bar code | Code | Required -5.2 | Text code | Code | Required -5.3 | Condition | Code | Required -6 | Priority | Number | Optional (default: `0`) +| | Argument | Type | Optional (default value) | +| --- | -------- | ---- | ------------------------ | +| 0 | Tabs to add the stat to | Array of arrays | Required | +| 0.1 | Left tab indexes | Array of numbers | Required | +| 0.2 | Right tab indexes | Array of numbers | Required | +| 1 | Stat class ID | String | Required | +| 2 | Config entries to pass | Array of strings | Required | +| 3 | Title | String | Required | +| 4 | Show bar / show text bools | Array of booleans | Required | +| 4.1 | Show bar | Boolean | Required | +| 4.2 | Show text | Boolean | Required | +| 5 | Array of statements | Array of code | Required | +| 5.1 | Bar code | Code | Required | +| 5.2 | Text code | Code | Required | +| 5.3 | Condition | Code | Required | +| 6 | Priority | Number | Optional (default: `0`) | Return Value: - Array of stat IDs @@ -262,9 +263,9 @@ If a stat already exists (so same class ID and tab), it will ignore the new addi `ace_arsenal_fnc_removeStat` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Array of IDs | Array | Required +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Array of IDs | Array | Required | Stats IDs are unique, IDs are generated as follows: @@ -344,15 +345,15 @@ The argument passed to the condition is: `ace_arsenal_fnc_addSort` -| | Argument | Type | Optional (default value) ---- | -------- | ---- | ------------------------ -0 | Tabs to add the sort to | Array of arrays | Required -0.1 | Left tab indexes | Array of numbers | Required -0.2 | Right tab indexes | Array of numbers | Required -1 | Stat class ID | String | Required -2 | Title | String | Required -3 | Algorithm | Code | Required -4 | Condition | Code | Optional (default: `{true}`) +| | Argument | Type | Optional (default value) | +| --- | -------- | ---- | ------------------------ | +| 0 | Tabs to add the sort to | Array of arrays | Required | +| 0.1 | Left tab indexes | Array of numbers | Required | +| 0.2 | Right tab indexes | Array of numbers | Required | +| 1 | Stat class ID | String | Required | +| 2 | Title | String | Required | +| 3 | Algorithm | Code | Required | +| 4 | Condition | Code | Optional (default: `{true}`) | Return Value: - Array of sort IDs @@ -381,9 +382,9 @@ If a sorting method already exists (so same class ID and tab), it will ignore th `ace_arsenal_fnc_removeSort` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Array of IDs | Array | Required +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Array of IDs | Array | Required | Sorting method IDs are unique and are generated in the same fashion as the stat IDs (see `5.3 Removing stats via a function`). @@ -402,6 +403,8 @@ For actions involving frame delays or timers, a second call of the `ace_arsenal_ Since CBA frame functions are deactivated during preInit as of Oct 24th 2023, the refresh function is executed immediatelly after the action code is executed. Take note of this information and the comment below if you'd like your actions to be usable in 3DEN. +By default actions are updated whenever the arsenal is refreshed (`ace_arsenal_fnc_refresh`) and whenever item info (the bottom right GUI element that shows item name and author) is updated. If any action with the `updateOnCargoChanged` property is added, then actions will also be updated on container inventory changes. + ### 7.1 Adding actions via config ```cpp @@ -410,6 +413,7 @@ class ace_arsenal_actions { displayName = "My Actions"; condition = QUOTE(true); scopeEditor = 2; // Only actions with scopeEditor = 2 are shown in 3DEN. Actions working with variables should take object variables being reset between editor view and mission start into account. + updateOnCargoChanged = 1; // See comment above. tabs[] = {0,5}; class text { // A simple text label @@ -417,6 +421,7 @@ class ace_arsenal_actions { }; class statement { // Statement output as text + // Return can be string or array of strings: for array each entry is automatically displayed on a separate line textStatement = QUOTE([_this select 0] call tag_fnc_myTextStatement); }; class button { @@ -433,14 +438,15 @@ The focused unit object is passed to the condition and statement functions. `ace_arsenal_fnc_addAction` -| | Argument | Type | Optional (default value) ---- | -------- | ---- | ------------------------ -0 | Tabs to add the sort to | Array of numbers | Required -1 | Action class ID | String | Required -2 | Title | String | Required -3 | Actions | Array of arrays | Required -4 | Condition | Code | Optional (default: `{true}`) -5 | Scope editor | Number | Optional (default: `2`) +| | Argument | Type | Optional (default value) | +| --- | -------- | ---- | ------------------------ | +| 0 | Tabs to add the sort to | Array of numbers | Required | +| 1 | Action class ID | String | Required | +| 2 | Title | String | Required | +| 3 | Actions | Array of arrays | Required | +| 4 | Condition | Code | Optional (default: `{true}`) | +| 5 | Scope editor | Number | Optional (default: `2`) | +| 6 | Update on cargo change | Boolean | Optional (default: `false`) | Return Value: - Array of action IDs @@ -468,9 +474,9 @@ If an action already exists (so same class ID and tab within an action), it will `ace_arsenal_fnc_removeAction` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Array of IDs | Array | Required +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Array of IDs | Array | Required | Action IDs are unique and their generation is explained in `7.2 Adding sorting methods via a function`. @@ -486,27 +492,28 @@ All are local. | Name | Arguments | Added in | | ------------- | ------------- | ------------- | -| ace_arsenal_boxInitialized | Arsenal box (OBJECT), items (BOOL or ARRAY) | -| ace_arsenal_boxRemoved | Arsenal box (OBJECT) | -| ace_arsenal_displayOpened | Arsenal display (DISPLAY) | -| ace_arsenal_displayClosed | None | -| ace_arsenal_leftPanelFilled | Arsenal display (DISPLAY), current left panel IDC (SCALAR), current right panel IDC (SCALAR) | -| ace_arsenal_rightPanelFilled | Arsenal display (DISPLAY), current left panel IDC (SCALAR), current right panel IDC (SCALAR) | -| ace_arsenal_onLoadoutSave | Loadout index (SCALAR), [loadout name (STRING), loadout data (ARRAY)] | -| ace_arsenal_onLoadoutSaveExtended | Loadout index (SCALAR), [loadout name (STRING), CBA extended loadout data (ARRAY)] | 3.15.1 -| ace_arsenal_onLoadoutLoad | loadout data (ARRAY), loadout name (STRING) | -| ace_arsenal_onLoadoutLoadExtended | CBA extended loadout data (ARRAY), loadout name (STRING) | 3.15.1 -| ace_arsenal_onLoadoutDelete | loadout name (STRING) | -| ace_arsenal_loadoutShared | Loadouts list listnBox control (CONTROL), loadout author (STRING), loadout name (STRING), loadout data (ARRAY) | -| ace_arsenal_loadoutUnshared | Loadouts list listnBox control (CONTROL), loadout author (STRING), loadout name (STRING) | -| ace_arsenal_cargoChanged | Arsenal display (DISPLAY), item (STRING), add or remove (NUMBER), shiftState (BOOL) | -| ace_arsenal_loadoutImported | Arsenal display (DISPLAY), import list (BOOL) | -| ace_arsenal_loadoutExported | Arsenal display (DISPLAY), export list (BOOL) | -| ace_arsenal_loadoutsDisplayOpened | loadouts screen display (DISPLAY) | 3.12.3 | -| ace_arsenal_loadoutsDisplayClosed | None | 3.12.3 | -| ace_arsenal_loadoutsTabChanged | loadouts screen display (DISPLAY), tab control (CONTROL) | 3.12.3 | -| ace_arsenal_loadoutsListFilled | loadouts screen display (DISPLAY), tab control (CONTROL) | 3.12.3 | -| ace_arsenal_weaponItemChanged | weapon classname (STRING), item classname (STRING), item index (NUMBER, 0-5: muzzle, side, optic, bipod, magazine, underbarrel) | 3.16.0 | +| `ace_arsenal_boxInitialized` | Arsenal box (OBJECT), items (BOOL or ARRAY) | +| `ace_arsenal_boxRemoved` | Arsenal box (OBJECT) | +| `ace_arsenal_displayOpened` | Arsenal display (DISPLAY) | +| `ace_arsenal_displayClosed` | None | +| `ace_arsenal_leftPanelFilled` | Arsenal display (DISPLAY), current left panel IDC (SCALAR), current right panel IDC (SCALAR) | +| `ace_arsenal_rightPanelFilled` | Arsenal display (DISPLAY), current left panel IDC (SCALAR), current right panel IDC (SCALAR) | +| `ace_arsenal_onLoadoutSave` | Loadout index (SCALAR), [loadout name (STRING), loadout data (ARRAY)] | +| `ace_arsenal_onLoadoutSaveExtended` | Loadout index (SCALAR), [loadout name (STRING), CBA extended loadout data (ARRAY)] | 3.15.1 +| `ace_arsenal_onLoadoutLoad` | loadout data (ARRAY), loadout name (STRING) | +| `ace_arsenal_onLoadoutLoadExtended` | CBA extended loadout data (ARRAY), loadout name (STRING) | 3.15.1 +| `ace_arsenal_onLoadoutDelete` | loadout name (STRING) | +| `ace_arsenal_loadoutShared` | Loadouts list listnBox control (CONTROL), loadout author (STRING), loadout name (STRING), loadout data (ARRAY) | +| `ace_arsenal_loadoutUnshared` | Loadouts list listnBox control (CONTROL), loadout author (STRING), loadout name (STRING) | +| `ace_arsenal_cargoChanged` | Arsenal display (DISPLAY), item (STRING), add or remove (NUMBER), shiftState (BOOL) | +| `ace_arsenal_loadoutImported` | Arsenal display (DISPLAY), import list (BOOL) | +| `ace_arsenal_loadoutExported` | Arsenal display (DISPLAY), export list (BOOL) | +| `ace_arsenal_loadoutsDisplayOpened` | loadouts screen display (DISPLAY) | 3.12.3 | +| `ace_arsenal_loadoutsDisplayClosed` | None | 3.12.3 | +| `ace_arsenal_loadoutsTabChanged` | loadouts screen display (DISPLAY), tab control (CONTROL) | 3.12.3 | +| `ace_arsenal_loadoutsListFilled` | loadouts screen display (DISPLAY), tab control (CONTROL) | 3.12.3 | +| `ace_arsenal_loadoutVerified` | loadout data (ARRAY), loadout CBA extended data (HASHMAP), null items (ARRAY), unavailable items (ARRAY), unavailable extended data (ARRAY) | 3.17.0 | +| `ace_arsenal_weaponItemChanged` | weapon classname (STRING), item classname (STRING), item index (NUMBER, 0-5: muzzle, side, optic, bipod, magazine, underbarrel) | 3.16.0 | ## 9. Custom sub item categories @@ -514,13 +521,13 @@ All are local. `ace_arsenal_fnc_addRightPanelButton` -| | Argument | Type | Optional (default value) ----| -------- | ---- | ------------------------ -0 | Misc. items | Array of strings | Required -1 | Tooltip | String | Optional (default: `""`) -2 | Picture path | String | Optional (default: `"\z\ace\addons\arsenal\data\iconCustom.paa"`) -3 | Override a specific button | Number | Optional (default: `-1`) -4 | Move button on overwrite | Bool | Optional (default: `false`) +| | Argument | Type | Optional (default value) | +|----| -------- | ---- | ------------------------ | +| 0 | Misc. items | Array of strings | Required | +| 1 | Tooltip | String | Optional (default: `""`) | +| 2 | Picture path | String | Optional (default: `"\z\ace\addons\arsenal\data\iconCustom.paa"`) | +| 3 | Override a specific button | Number | Optional (default: `-1`) | +| 4 | Move button on overwrite | Bool | Optional (default: `false`) | Return Value: - Successful: Number of the slot (0-9) diff --git a/docs/wiki/framework/attach-framework.md b/docs/wiki/framework/attach-framework.md index 2ed5f74561..f118b3b934 100644 --- a/docs/wiki/framework/attach-framework.md +++ b/docs/wiki/framework/attach-framework.md @@ -15,7 +15,7 @@ version: ## 1. Config Values ### 1.1 Make item attachable -An item can be added to the ACE Attach framework by adding the ``ACE_attachable`` property to a class in ``CfgWeapons`` or ``CfgMagazines``. The value must be the classname of a valid class in ``CfgVehicles``: +An item can be added to the ACE Attach framework by adding the `ACE_attachable` property to a class in `CfgWeapons` or `CfgMagazines`. The value must be the classname of a valid class in `CfgVehicles`: ```cpp class CfgWeapons { class attach_item: CBA_MiscItem { @@ -29,16 +29,16 @@ class CfgVehicles { scope = 1; // Should be 1 (private) or 2 (public), scope 0 will cause errors on object creation displayName = "New ACE attachable item"; model = "\path\to\my\model.p3d"; - vehicleClass = ""; + vehicleClass = ""; }; }; ``` ### 1.2 Define attach orientation for non-symmetric items -In the case the item needs to have a particular orientation when attached, add the config value: ``ace_attach_orientation`` which is an array describing the ``roll`` and ``yaw`` orientation of the object. -The default value is: ``[0,0]``. +In the case the item needs to have a particular orientation when attached, add the config value: `ace_attach_orientation` which is an array describing the `roll` and `yaw` orientation of the object. +The default value is: `[0,0]`. -Example: +Example: ```cpp class CfgWeapons { class attach_item: CBA_MiscItem { @@ -49,11 +49,11 @@ class CfgWeapons { ``` ## 2. Event Handlers -### 2.1 Listenable Events +### 2.1 Listenable Events | Event Key | Parameters | Locality | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_attach_attached` | [_attachedObject, _itemClassname, _temporary] | Local | Called after an item is attached to an object. `_temporary` flag means the item is being re-attached (after a unit is exiting a vehicle, for example) -|`ace_attach_detaching` | [_attachedObject, _itemClassname, _temporary] | Local | Called just before an item is detached/removed from an object. `_temporary` flag means the item will be reattached later, see above. +|----------|---------|---------|---------| +|`ace_attach_attached` | [_attachedObject, _itemClassname, _temporary] | Local | Called after an item is attached to an object. `_temporary` flag means the item is being re-attached (after a unit is exiting a vehicle, for example) | +|`ace_attach_detaching` | [_attachedObject, _itemClassname, _temporary] | Local | Called just before an item is detached/removed from an object. `_temporary` flag means the item will be reattached later, see above. | ### 2.2 Other events for attached objects Use [CBA Extended Event Handlers](https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)). Note that objects attached to units will be deleted/created upon entering/exiting vehicles and should be handled accordingly. diff --git a/docs/wiki/framework/dragging-framework.md b/docs/wiki/framework/dragging-framework.md index f4400aed44..43a7c98ba4 100644 --- a/docs/wiki/framework/dragging-framework.md +++ b/docs/wiki/framework/dragging-framework.md @@ -46,58 +46,58 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is `ace_dragging_fnc_setDraggable` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Any object | Object | Required -1 | Enable dragging, true to enable, false to disable | Boolean | Required -2 | Position to offset the object from player | Array | Optional (default: `[0, 1.5, 0]`) -3 | Direction in degree to rotate the object | Number | Optional (default: `0`) -4 | Ignore weight limitation for dragging | Boolean | Optional (default: `false`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Any object | Object | Required | +| 1 | Enable dragging, true to enable, false to disable | Boolean | Required | +| 2 | Position to offset the object from player | Array | Optional (default: `[0, 1.5, 0]`) | +| 3 | Direction in degree to rotate the object | Number | Optional (default: `0`) | +| 4 | Ignore weight limitation for dragging | Boolean | Optional (default: `false`) | +| **R** | None | None | Return value | #### 2.1.1 Example 1 `[foo, true, [0, 2, 0], 45] call ace_dragging_fnc_setDraggable;` - | Arguments | Explanation ----| --------- | ----------- -0 | `foo` | My object -1 | `true` | Dragging is enabled -2 | `[0,2,0]` | 0 meters sideways, 2 meters forward, 0 meters upwards -3 | `45` | Rotated by 45° +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `foo` | My object | +| 1 | `true` | Dragging is enabled | +| 2 | `[0,2,0]` | 0 meters sideways, 2 meters forward, 0 |meters upwards +| 3 | `45` | Rotated by 45° | #### 2.1.2 Example 2 `[bar, false, [3, -2, 2], 20] call ace_dragging_fnc_setDraggable;` - | Arguments | Explanation ----| --------- | ----------- -0 | `bar` | My object -1 | `false` | Dragging is disabled -2 | `[3, -2, 2]` | 3 meters sideways, 2 meters backwards, 2 meters upwards -3 | `20` | Rotated by 20° +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `bar` | My object | +| 1 | `false` | Dragging is disabled | +| 2 | `[3, -2, 2]` | 3 meters sideways, 2 meters backwards, 2 meters upwards | +| 3 | `20` | Rotated by 20° | ### 2.2 Enabling / disabling carrying `ace_dragging_fnc_setCarryable` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Any object | Object | Required -1 | Enable carrying, true to enable, false to disable | Boolean | Required -2 | Position to offset the object from player | Array | Optional (default: `[0, 1, 1]`) -3 | Direction in degree to rotate the object | Number | Optional (default: `0`) -4 | Ignore weight limitation for carrying | Boolean | Optional (default: `false`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Any object | Object | Required | +| 1 | Enable carrying, true to enable, false to disable | Boolean | Required | +| 2 | Position to offset the object from player | Array | Optional (default: `[0, 1, 1]`) | +| 3 | Direction in degree to rotate the object | Number | Optional (default: `0`) | +| 4 | Ignore weight limitation for carrying | Boolean | Optional (default: `false`) | +| **R** | None | None | Return value | #### 2.2.1 Example `[foo, true, [0, 3, 1], 10] call ace_dragging_fnc_setCarryable;` - | Arguments | Explanation ----| --------- | ----------- -0 | `foo` | My object -1 | `true`| Carrying is enabled -2 | `[0,2,0]` | 0 meters sideways, 3 meters forward, 1 meter upwards -3 | `10` | Rotated by 10° +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `foo` | My object | +| 1 | `true`| Carrying is enabled | +| 2 | `[0,2,0]` | 0 meters sideways, 3 meters forward, 1 meter upwards | +| 3 | `10` | Rotated by 10° | diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index c29f271719..bec6492c96 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -23,31 +23,32 @@ E.G.: If you only need to do action when player's weapon fires, this will be fas The vehicle events will also have the following local variables available `_gunner (OBJECT), _turret (ARRAY)`. | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_firedPlayer` | [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | ACE_player fires -|`ace_firedPlayerNonLocal` | [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | Any other player fires -|`ace_firedNonPlayer` | [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | AI fires -|`ace_firedPlayerVehicle` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | ACE_player turret fires -|`ace_firedPlayerVehicleNonLocal` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | Any other player turret fires -|`ace_firedNonPlayerVehicle` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | AI turret fires +|----------|---------|---------|---------|---------| +|`ace_firedPlayer` | [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | ACE_player fires | +|`ace_firedPlayerNonLocal` | [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | Any other player fires | +|`ace_firedNonPlayer` | [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | AI fires | +|`ace_firedPlayerVehicle` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | ACE_player turret fires | +|`ace_firedPlayerVehicleNonLocal` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | Any other player turret fires | +|`ace_firedNonPlayerVehicle` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | AI turret fires | ### 2.2 Medical (`ace_medical`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed -|`ace_placedInBodyBag` | [_target, _bodyBag, _isGrave] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted, target could be a bodybag) -|`ace_placedInGrave` | [_target, _grave] | Global | Listen | Target placed into a grave, _grave will be objNull if `Create Grave Markers` is disabled Note: (Target will soon be deleted) -|`ace_treatmentStarted` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action has started (local on the _caller) -|`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller) -|`ace_treatmentFailed` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action has been interrupted (local on the _caller) -|`ace_medical_handleUnitVitals` | [_unit, _deltaT] | Local | Listen | Vitals update ran for unit, _deltaT is the time elapsed since the previous vitals update (local to _unit) +|----------|---------|---------|---------|---------| +|`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed | +|`ace_placedInBodyBag` | [_target, _bodyBag, _isGrave] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted, target could be a bodybag) | +|`ace_placedInGrave` | [_target, _grave] | Global | Listen | Target placed into a grave, _grave will be objNull if `Create Grave Markers` is disabled Note: (Target will soon be deleted) | +|`ace_treatmentStarted` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem, _createLitter] | Local | Listen | Treatment action has started (local on the _caller) | +|`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem, _createLitter] | Local | Listen | Treatment action is completed (local on the _caller) | +|`ace_treatmentFailed` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem, _createLitter] | Local | Listen | Treatment action has been interrupted (local on the _caller) | +|`ace_medical_handleUnitVitals` | [_unit, _deltaT] | Local | Listen | Vitals update ran for unit, _deltaT is the time elapsed since the previous vitals update (local to _unit) | +|`ace_medical_treatment_bandaged` | [_medic, _patient, _bodyPart, _className, _itemUser, _usedItem, _createLitter, _bandageEffectiveness] | Local | Listen | _medic has bandaged _patient, the array can be modified to change treatment parameters (local to _medic) | ### 2.3 Interaction Menu (`ace_interact_menu`) MenuType: 0 = Interaction, 1 = Self Interaction | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| +|----------|---------|---------|---------|---------| |`ace_interactMenuOpened` | [_menuType] | Local | Listen | Interaction Menu Opened |`ace_interactMenuClosed` | [_menuType] | Local | Listen | Interaction Menu Closed |`ace_interact_menu_newControllableObject` | [_typeOf] | Local | Listen | New controlable object, only fires once per type (add self interactions) @@ -55,79 +56,109 @@ MenuType: 0 = Interaction, 1 = Self Interaction ### 2.4 Cargo (`ace_cargo`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_addCargo` | [_item (CLASSNAME or OBJECT), _vehicle, _cargoCount] | Target | Callable | Scripted way to add cargo to vehicle -|`ace_cargoLoaded` | [_item, _vehicle] | Global | Listen | Cargo has been Loaded into vehicle -|`ace_cargoUnloaded` | [_item, _vehicle, _unloadType] | Global | Listen | Cargo has been Unloaded from vehicle +|----------|---------|---------|---------|---------| +|`ace_addCargo` | [_item (CLASSNAME or OBJECT), _vehicle, _cargoCount] | Target | Callable | Scripted way to add cargo to vehicle | +|`ace_cargoLoaded` | [_item, _vehicle] | Global | Listen | Cargo has been Loaded into vehicle | +|`ace_cargoUnloaded` | [_item, _vehicle, _unloadType] | Global | Listen | Cargo has been Unloaded from vehicle | ### 2.5 Captives (`ace_captives`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_captiveStatusChanged` | [_unit, _state(BOOL), _reason ("SetHandcuffed" or "SetSurrendered"), _caller] | Global | Listen | Unit's captivity state changed -|`ace_captives_setSurrendered` | [_unit, _state(BOOL)] | Target | Callable | Sets a unit to either start or stop surrendering -|`ace_captives_setHandcuffed` | [_unit, _state(BOOL)] | Target | Callable | Sets a unit to either start or stop being handcuffed -|`ace_captives_escortingCaptive` | [_unit, _state(BOOL), _caller] | Local | Listen | Caller starting or stopping escort of unit +|----------|---------|---------|---------|---------| +|`ace_captiveStatusChanged` | [_unit, _state(BOOL), _reason ("SetHandcuffed" or "SetSurrendered"), _caller] | Global | Listen | Unit's captivity state changed | +|`ace_captives_setSurrendered` | [_unit, _state(BOOL)] | Target | Callable | Sets a unit to either start or stop surrendering | +|`ace_captives_setHandcuffed` | [_unit, _state(BOOL)] | Target | Callable | Sets a unit to either start or stop being handcuffed | +|`ace_captives_escortingCaptive` | [_unit, _state(BOOL), _caller] | Local | Listen | Caller starting or stopping escort of unit | ### 2.6 Settings (`ace_common`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_settingsInitialized` | [] | Local | Listen | All modules are read and settings are ready -|`ace_settingChanged` | [_name,_value] | Local | Listen | A setting has been changed +|----------|---------|---------|---------|---------| +|`ace_settingsInitialized` | [] | Local | Listen | All modules are read and settings are ready | +|`ace_settingChanged` | [_name,_value] | Local | Listen | A setting has been changed | ### 2.7 Tagging (`ace_tagging`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_tagCreated` | [_tagObject, _texture, _tagAttachedTo (can be null), _unitThatCreated] | Global | Listen | Tag is created +|----------|---------|---------|---------|---------| +|`ace_tagCreated` | [_tagObject, _texture, _tagAttachedTo (can be null), _unitThatCreated] | Global | Listen | Tag is created | ### 2.8 Explosives (`ace_explosives`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_allowDefuse` | [_mine, _allow] | Global or Target | Callable | Set allowance of the dynamic defusal action on a mine -|`ace_tripflareTriggered` | [_flareObject, [_posX, _posY, _posZ]] | Global | Listen | Tripflare triggered -|`ace_explosives_clackerAdded` | [_unit, _explosive, _id] | Local | Listen | Clacker added to explosive -|`ace_explosives_place` | [_explosive, _dir, _pitch, _unit] | Global | Listen | Explosive is armed -|`ace_explosives_setup` | [_explosiveVehicle, _magClassname, _unit] | Global | Listen | Explosive is placed in the world +|----------|---------|---------|---------|---------| +|`ace_allowDefuse` | [_mine, _allow] | Global or Target | Callable | Set allowance of the dynamic defusal action on a mine | +|`ace_tripflareTriggered` | [_flareObject, [_posX, _posY, _posZ]] | Global | Listen | Tripflare triggered | +|`ace_explosives_clackerAdded` | [_unit, _explosive, _id] | Local | Listen | Clacker added to explosive | +|`ace_explosives_place` | [_explosive, _dir, _pitch, _unit] | Global | Listen | Explosive is armed | +|`ace_explosives_setup` | [_explosiveVehicle, _magClassname, _unit] | Global | Listen | Explosive is placed in the world | ### 2.9 Logistics Wirecutter (`ace_logistics`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_wireCuttingStarted` | [_unit, _fence] | Global | Listen | Fence cutting started +|----------|---------|---------|---------|---------| +|`ace_wireCuttingStarted` | [_unit, _fence] | Global | Listen | Fence cutting started | ### 2.9 Refuel (`ace_refuel`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_refuel_started` | [_source, _target] | Local | Listen | Refueling has started -|`ace_refuel_tick` | [_source, _target, _amount] | Local | Listen | Amount of fuel transferred in a tick -|`ace_refuel_stopped` | [_source, _target] | Local | Listen | Refueling has stopped +|----------|---------|---------|---------|---------| +|`ace_refuel_started` | [_source, _target] | Local | Listen | Refueling has started | +|`ace_refuel_tick` | [_source, _target, _amount] | Local | Listen | Amount of fuel transferred in a tick | +|`ace_refuel_stopped` | [_source, _target] | Local | Listen | Refueling has stopped | ### 2.10 Cook Off (`ace_cookoff`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| +|----------|---------|---------|---------|---------| |`ace_cookoff_cookOff` | _vehicle | Global | Listen | Vehicle cook off has started -|`ace_cookoff_cookOffBox` | _box | Global | Listen | Ammo box cook off has started -|`ace_cookoff_engineFire` | _vehicle | Global | Listen | Engine fire has started +|`ace_cookoff_cookOffBox` | _box | Global | Listen | Ammo box cook off has started | +|`ace_cookoff_engineFire` | _vehicle | Global | Listen | Engine fire has started | ### 2.11 Attach (`ace_attach`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------|---------| -|`ace_attach_attached` | [_attachedObject, _itemClassname, _temporary] | Local | Listen | After an item was attached to a unit/vehicle. _temporary flag means a item is being re-attached after the player exits a vehicle -|`ace_attach_detaching` | [_attachedObject, _itemName, _temporary] | Local | Listen | Just before an item gets detached/removed from a unit/vehicle. _temporary flag means its detached because the player unit entered a vehicle. +|----------|---------|---------|---------|---------| +|`ace_attach_attached` | [_attachedObject, _itemClassname, _temporary] | Local | Listen | After an item was attached to a unit/vehicle. _temporary flag means a item is being re-attached after the player exits a vehicle | +|`ace_attach_detaching` | [_attachedObject, _itemName, _temporary] | Local | Listen | Just before an item gets detached/removed from a unit/vehicle. _temporary flag means its detached because the player unit entered a vehicle. | ### 2.12 Trenches (`ace_trenches`) | Event Key | Parameters | Locality | Type | Description | |---------- |------------|----------|------|-------------| -| `ace_trenches_placed` | [_unit, _trench] | Global | Listen | After trench object is placed by unit. -| `ace_trenches_finished` | [_unit, _trench] | Global | Listen | After trench object is fully dug up by unit (100% progress). +| `ace_trenches_placed` | [_unit, _trench] | Global | Listen | After trench object is placed by unit. | +| `ace_trenches_finished` | [_unit, _trench] | Global | Listen | After trench object is fully dug up by unit (100% progress). | + +### 2.13 Medical GUI (`ace_medical_gui`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_medical_gui_updateBodyImage` | [_ctrlGroup, _target, _selectionN] | Local | Listen | Allows mods to update any modifications they have made to the body image +| `ace_medical_gui_updateInjuryListGeneral` | [_ctrl, _target, _selectionN, _entries] | Local | Listen | Allows mods to update the general injury list by pushing to the _entries array +| `ace_medical_gui_updateInjuryListPart` | [_ctrl, _target, _selectionN, _entries, _bodyPartName] | Local | Listen | Allows mods to update the part injury list by pushing to the _entries array +| `ace_medical_gui_updateInjuryListWounds` | [_ctrl, _target, _selectionN, _woundEntries, _bodyPartName] | Local | Listen | Allows mods to update the wounds injury list by pushing to the _woundEntries array +| `ace_medical_gui_logListAppended` | [_ctrl, _row, _message, _unlocalizedMessage, _timeStamp, _arguments] | Local | Listen | After an entry is appended to the log list + +### 2.14 Medical Treatment (`ace_medical_treatment`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_medical_treatment_fullHealLocalMod` | [_patient] | Local | Listen | Called before a local unit is fully healed, mods can listen and apply their own healing logic + +### 2.15 Medical Status (`ace_medical_status`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_medical_status_getBloodLoss` | [_unit, _bloodLoss] | Local | Listen | Called when blood loss is calculated for a unit, mods can listen and modify the blood loss value by modifying the array + +### 2.16 Interaction (`ace_interaction`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +|---------- |------------|----------|------|-------------| +| `ace_interaction_doorOpeningStarted` | [_house, _door, _animations] | Local | Listen | Called when local unit starts interacting with doors +| `ace_interaction_doorOpeningStopped` | [_house, _door, _animations] | Local | Listen | Called when local unit stopps interacting with doors ## 3. Usage Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System){:target="_blank"} documentation. @@ -138,21 +169,21 @@ Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom `CBA_fnc_addEventHandler` - Adds an event handler with the event name and returns the event handler ID. - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Code block | Code | Required -**R** | Event ID | Number | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Code block | Code | Required | +| **R** | Event ID | Number | Return value | #### 3.1.2 Remove Event `CBA_fnc_removeEventHandler` - Removes a specific event handler of the given event name, using the ID returned from `CBA_fnc_addEventHandler`. - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Event ID | Number | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Event ID | Number | Required | +| **R** | None | None | Return value | ### 3.2 Calling Events @@ -160,42 +191,42 @@ Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom `CBA_fnc_localEvent` - Calls an event only on the local machine, useful for inter-module events. - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Arguments | Any | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Arguments | Any | Required | +| **R** | None | None | Return value | #### 3.2.2 Target Event `CBA_fnc_targetEvent` - Calls an event only on the target machine or list of target machines. - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Arguments | Any | Required -2 | Target(s) | Object OR Number OR Array | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Arguments | Any | Required | +| 2 | Target(s) | Object OR Number OR Array | Required | +| **R** | None | None | Return value | #### 3.2.3 Server Event `CBA_fnc_serverEvent` - Calls an event only on the server machine (dedicated or self-hosted). - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Arguments | Any | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Arguments | Any | Required | +| **R** | None | None | Return value | #### 3.2.4 Global Event `CBA_fnc_globalEvent` - Calls an event on all machines - the local machine, and the server machine. - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Arguments | Any | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Arguments | Any | Required | +| **R** | None | None | Return value | ### 3.3 Synchronized Events @@ -206,12 +237,12 @@ Adds a globally synchronized event handler which will expire events after the pr `ace_common_fnc_addSyncedEventHandler` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Code block | Code | Required -2 | Time to live | Number OR Code | Optional (default: `0`) -**R** | Event ID | Number | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Code block | Code | Required | +| 2 | Time to live | Number OR Code | Optional (default: `0`) | +| **R** | Event ID | Number | Return value | #### 3.3.2 Remove Synchronized Event @@ -219,10 +250,10 @@ Removes a specific event handler of the given event name, using the ID returned `ace_common_fnc_removeSyncedEventHandler` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| **R** | None | None | Return value | #### 3.3.3 Call Synchronized Event @@ -230,12 +261,12 @@ Calls a globally synchronized event, which will also be run on JIP players unles `ace_common_fnc_syncedEvent` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Event name | String | Required -1 | Arguments | Any | Required -2 | Time to live for this call | Number OR Code | Optional (default: `0`) -**R** | Event ID | Number | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Event name | String | Required | +| 1 | Arguments | Any | Required | +| 2 | Time to live for this call | Number OR Code | Optional (default: `0`) | +| **R** | Event ID | Number | Return value | ### 3.4 Example diff --git a/docs/wiki/framework/explosives-framework.md b/docs/wiki/framework/explosives-framework.md index 9d943e3eee..8abffa9448 100644 --- a/docs/wiki/framework/explosives-framework.md +++ b/docs/wiki/framework/explosives-framework.md @@ -120,16 +120,16 @@ class CfgWeapons { ## 4. Trigger list -Name | Use ----- | ----- -`Command` | Explode when activated via clacker. -`MK16_Transmitter` | Explode when activated via M26 clacker. -`DeadManSwitch` | Explode after activated via the switch or the person dies. -`Cellphone` | Explode when the number is called. -`PressurePlate` | Explode upon being stepped upon. -`IRSensor` | Explode after movement is detected in front of the mine. -`Timer` | Explode after timer drop to 0. -`Tripwire` | Explode when something touch the tripwire. +| Name | Use | +| ---- | ----- | +| `Command` | Explode when activated via clacker. | +| `MK16_Transmitter` | Explode when activated via M26 clacker. | +| `DeadManSwitch` | Explode after activated via the switch or the person dies. | +| `Cellphone` | Explode when the number is called. | +| `PressurePlate` | Explode upon being stepped upon. | +| `IRSensor` | Explode after movement is detected in front of the mine. | +| `Timer` | Explode after timer drop to 0. | +| `Tripwire` | Explode when something touch the tripwire. | ## 5. Scripting @@ -138,41 +138,41 @@ Name | Use `ace_explosives_fnc_scriptedExplosive` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Explosive objects | Array | Required -1 | Delay before detonation | Number | Optional (default: `0`, randomized up to given number if negative) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Explosive objects | Array | Required | +| 1 | Delay before detonation | Number | Optional (default: `0`, randomized up to given number if negative) | +| **R** | None | None | Return value | #### 5.1.1 Example `[[charge1, charge2], -3] call ace_explosives_fnc_scriptedExplosive;` - | Arguments | Explanation ----| --------- | ----------- -0 | `[charge1, charge2]` | Explosive objects to detonate -1 | `-3` | Randomized delay, up to 3 seconds +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `[charge1, charge2]` | Explosive objects to detonate | +| 1 | `-3` | Randomized delay, up to 3 seconds | ### 5.2 Connect Explosive `ace_explosives_fnc_connectExplosive` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Unit to connect to | Object | Required -1 | Explosive object to connect to | Object | Required -2 | Detonator type class name (must be present on unit) | String | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Unit to connect to | Object | Required | +| 1 | Explosive object to connect to | Object | Required | +| 2 | Detonator type class name (must be present on unit) | String | Required | +| **R** | None | None | Return value | #### 5.2.1 Example `[player, claymore1, "ACE_Clacker"] call ace_explosives_fnc_connectExplosive;` - | Arguments | Explanation ----| --------- | ----------- -0 | `player` | Unit explosive will connect to -1 | `claymore1` | Explosive object that will be connected -2 | `"ACE_Clacker"` | Detonator type class name +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `player` | Unit explosive will connect to | +| 1 | `claymore1` | Explosive object that will be connected | +| 2 | `"ACE_Clacker"` | Detonator type class name | #### 5.3 Detonation Handler. @@ -207,7 +207,7 @@ Jammer that blocks RF triggers: #### 5.4 Disabling `setShotParents`. -ACE will set the owner/instigator of the explosive to the unit placeing/detonating it. +ACE will set the owner/instigator of the explosive to the unit placing/detonating it. This can be disabled by executing ```sqf diff --git a/docs/wiki/framework/fastroping-framework.md b/docs/wiki/framework/fastroping-framework.md index fad016a8bf..57c6b9055d 100644 --- a/docs/wiki/framework/fastroping-framework.md +++ b/docs/wiki/framework/fastroping-framework.md @@ -18,7 +18,7 @@ If you want to prepare a helicopter from your addon for fastroping, there's a fe By using simple rope origin points you will only need two config entries: -``` +```cpp ace_fastroping_enabled = 1; ace_fastroping_ropeOrigins[] = { {x, y, z}, @@ -28,7 +28,7 @@ ace_fastroping_ropeOrigins[] = { This will create the ropes at the two given points. If you have defined memory points for the rope origins, you can use them too: -``` +```cpp ace_fastroping_enabled = 1; ace_fastroping_ropeOrigins[] = {"ropeOriginLeft", "ropeOriginRight"}; ``` @@ -41,7 +41,7 @@ If your helicopter is not fastroping capable by default, you can make it take a To make your helicopter FRIES capable, you need to add the following config entries: -``` +```cpp ace_fastroping_enabled = 2; ace_fastroping_friesType = "yourFRIESType"; ace_fastroping_friesAttachmentPoint[] = {x, y, z}; @@ -87,16 +87,16 @@ ACE3 provides two functions that are compatible with most helicopters and all AC `ace_fastroping_fnc_equipFRIES` -| | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Helicopter | Object | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Helicopter | Object | Required | +| **R** | None | None | Return value | ### 4.2. Remove FRIES from helicopter `ace_fastroping_fnc_unequipFRIES` -| | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Helicopter | Object | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Helicopter | Object | Required | +| **R** | None | None | Return value | diff --git a/docs/wiki/framework/field-rations-framework.md b/docs/wiki/framework/field-rations-framework.md index bc433e7d52..34b8b8fbcd 100644 --- a/docs/wiki/framework/field-rations-framework.md +++ b/docs/wiki/framework/field-rations-framework.md @@ -16,19 +16,19 @@ redirect_from: "/wiki/frameworkx/field-rations-framework.html" ### 1.1 Consumable Items -Config Name | Type | Description ------------ | ---- | ----------- -`acex_field_rations_thirstQuenched` | Number | Amount of thirst quenched when item is consumed* -`acex_field_rations_hungerSatiated` | Number | Amount of hunger satiated when item is consumed* -`acex_field_rations_consumeTime` | Number | Time required to consume the item (in seconds) -`acex_field_rations_consumeText` | String | Progress bar text (OPTIONAL) -`acex_field_rations_consumeAnims` | Array | Animations to play when consuming item** (OPTIONAL) -`acex_field_rations_consumeSounds` | Array | Sounds to play when consuming item** (OPTIONAL) -`acex_field_rations_replacementItem` | String | Class name of replacement item to add on consumption (OPTIONAL) -`acex_field_rations_refillItem` | String | Makes an item refillable, class name of item added when refilled (OPTIONAL) -`acex_field_rations_refillAmount` | Number | Amount of water required to refill item (OPTIONAL) -`acex_field_rations_refillTime` | Number | Time required to refill item (in seconds) (OPTIONAL) -`ACE_isFieldRationItem` | Number | Force adds the item to the ACE Field Rations category in ACE Arsenal (OPTIONAL) +| Config Name | Type | Description | +| ----------- | ---- | ----------- | +| `acex_field_rations_thirstQuenched` | Number | Amount of thirst quenched when item is consumed* | +| `acex_field_rations_hungerSatiated` | Number | Amount of hunger satiated when item is consumed* | +| `acex_field_rations_consumeTime` | Number | Time required to consume the item (in seconds) | +| `acex_field_rations_consumeText` | String | Progress bar text (OPTIONAL) | +| `acex_field_rations_consumeAnims` | Array | Animations to play when consuming item** (OPTIONAL) | +| `acex_field_rations_consumeSounds` | Array | Sounds to play when consuming item** (OPTIONAL) | +| `acex_field_rations_replacementItem` | String | Class name of replacement item to add on consumption (OPTIONAL) | +| `acex_field_rations_refillItem` | String | Makes an item refillable, class name of item added when refilled (OPTIONAL) | +| `acex_field_rations_refillAmount` | Number | Amount of water required to refill item (OPTIONAL) | +| `acex_field_rations_refillTime` | Number | Time required to refill item (in seconds) (OPTIONAL) | +| `ACE_isFieldRationItem` | Number | Force adds the item to the ACE Field Rations category in ACE Arsenal (OPTIONAL) | _* Value range is 0 to 100 and can be modified by the corresponding coefficient setting._ @@ -37,17 +37,17 @@ _** Array is in format: STAND, CROUCH, PRONE. If player is in vehicle, the first ### 1.2 Water Sources -Config Name | Type | Description ------------ | ---- | ----------- -`acex_field_rations_waterSupply` | Number | Amount of water inside the object (-1 - disabled, -10 - infinite) (OPTIONAL) -`acex_field_rations_offset` | Array | Refill action offset relative to model (OPTIONAL) +| Config Name | Type | Description | +| ----------- | ---- | ----------- | +| `acex_field_rations_waterSupply` | Number | Amount of water inside the object (-1 - disabled, -10 - infinite) (OPTIONAL) | +| `acex_field_rations_offset` | Array | Refill action offset relative to model (OPTIONAL) | ## 2. Events -Event Name | Passed Parameter(s) | Locality | Description ----------- | ------------------- | -------- | ----------- -`acex_rationConsumed` | [_player, _consumeItem, _replacementItem, _thirstQuenched, _hungerSatiated, _isMagazine] | Local | Item consumed -`acex_rationRefilled` | [_source, _player, _item, _refillItem, _refillAmount, _isMagazine] | Local | Item refilled +| Event Name | Passed Parameter(s) | Locality | Description | +| ---------- | ------------------- | -------- | ----------- | +| `acex_rationConsumed` | [_player, _consumeItem, _replacementItem, _thirstQuenched, _hungerSatiated, _isMagazine] | Local | Item consumed | +| `acex_rationRefilled` | [_source, _player, _item, _refillItem, _refillAmount, _isMagazine] | Local | Item refilled | ## 3. Scripting diff --git a/docs/wiki/framework/fire-framework.md b/docs/wiki/framework/fire-framework.md index 2236c5a1c8..7994036ece 100644 --- a/docs/wiki/framework/fire-framework.md +++ b/docs/wiki/framework/fire-framework.md @@ -21,19 +21,28 @@ Use `CBA_fnc_serverEvent` to use the following features. Events are defined only `ace_fire_addFireSource` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Source of flame | Object/Position ASL | Required -1 | Radius of fire | Number | Required -2 | Intensity of fire (1, 10] | Number | Required -3 | Fire source ID | Any | Required -4 | Condition to stop fire | Code | Optional (default: `{ true }`) -5 | Arguments to pass to condition | Any | Optional (default: `[]`) +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Source of flame | Object/Position ASL | Required | +| 1 | Radius of fire | Number | Required | +| 2 | Intensity of fire (1, 10] | Number | Required | +| 3 | Fire source ID | Any | Required | +| 4 | Condition to stop fire | Code | Optional (default: `{ true }`) | +| 5 | Arguments to pass to condition | Any | Optional (default: `[]`) | ### 1.2 Removing fire source `ace_fire_removeFireSource` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Fire source ID | Any | Required +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Fire source ID | Any | Required | + + +## 2. Variables + +Screams can be disabled for an individual unit by setting the `ace_fire_enableScreams` variable on the unit, which can be synced across machines. + +```sqf +_unit setVariable ["ace_fire_enableScreams", false, _isGlobal]; +``` diff --git a/docs/wiki/framework/fortify-framework.md b/docs/wiki/framework/fortify-framework.md index 3f6619a746..9de0fab35b 100644 --- a/docs/wiki/framework/fortify-framework.md +++ b/docs/wiki/framework/fortify-framework.md @@ -114,10 +114,11 @@ The Fortify budget can be updated for any side using the function. ### 2.1 Listenable -Event Name | Passed Parameter(s) | Locality | Description ----------- | ----------- | ------------------- | -------- -`acex_fortify_objectPlaced` | [player, side, objectPlaced] | Global | Foritfy object placed -`acex_fortify_objectDeleted` | [player, side, objectDeleted] | Global | Foritfy object deleted -`acex_fortify_onDeployStart` | [player, object, cost] | Local | Player starts placing object -`ace_fortify_deployFinished` | [player, side, configName, posASL, vectorDir, vectorUp] | Local | Player successfully finishes building object -`ace_fortify_deployCanceled` | [player, side, configName, posASL, vectorDir, vectorUp] | Local | Player cancels building object +| Event Name | Passed Parameter(s) | Locality | Description | +| ---------- | ----------- | ------------------- | -------- | +| `acex_fortify_objectPlaced` | [player, side, objectPlaced] | Global | Fortify object placed | +| `acex_fortify_objectDeleted` | [player, side, objectDeleted] | Global | Fortify object deleted | +| `acex_fortify_onDeployStart` | [player, object, cost] | Local | Player starts placing object | +| `ace_fortify_onDeployStop` | [player, object, cost] | Local | Player stops placing object. Raised only if stopped before trying to place (= before progress bar appears). If it's during progress bar, only `ace_fortify_deployCanceled` is raised. | +| `ace_fortify_deployFinished` | [[player, side, configName, posASL, vectorDir, vectorUp, cost], elapsedTime, totalTime, errorCode] | Local | Player successfully finishes building object | +| `ace_fortify_deployCanceled` | [[player, side, configName, posASL, vectorDir, vectorUp, cost], elapsedTime, totalTime, errorCode] | Local | Player cancels building object | diff --git a/docs/wiki/framework/frag-framework.md b/docs/wiki/framework/frag-framework.md index 07c59764f5..d05f5068f6 100644 --- a/docs/wiki/framework/frag-framework.md +++ b/docs/wiki/framework/frag-framework.md @@ -60,22 +60,22 @@ Dimensionless value, as long as same unit as `ace_frag_metal` (for example `kg/k Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is **not** the detonation velocity of the explosive, do not confuse them! -Type | Speed ---------------- | -------- -Composition B | 2700 m/s -Composition C-3 | 2680 m/s -Cyclotol 75/25 | 2790 m/s -HMX | 2800 m/s -LX-14 | 2970 m/s -Octol 75/25 | 2800 m/s -PBX 9404 | 2900 m/s -PBX 9502 | 2377 m/s -Pentolite | 2750 m/s -PETN | 2930 m/s -RDX | 2830 m/s -Tetryl | 2500 m/s -TNT | 2440 m/s -Tritonal | 2320 m/s +| Type | Speed | +| --------------- | -------- | +| Composition B | 2700 m/s | +| Composition C-3 | 2680 m/s | +| Cyclotol 75/25 | 2790 m/s | +| HMX | 2800 m/s | +| LX-14 | 2970 m/s | +| Octol 75/25 | 2800 m/s | +| PBX 9404 | 2900 m/s | +| PBX 9502 | 2377 m/s | +| Pentolite | 2750 m/s | +| PETN | 2930 m/s | +| RDX | 2830 m/s | +| Tetryl | 2500 m/s | +| TNT | 2440 m/s | +| Tritonal | 2320 m/s | ### 1.4 Gurney shape factor @@ -83,11 +83,11 @@ Tritonal | 2320 m/s Shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors. -Shape | Factor --------- | ------ -Sphere | 3/5 -Cylinder | 1/2 -Plate | 3/5 +| Shape | Factor | +| -------- | ------ | +| Sphere | 3/5 | +| Cylinder | 1/2 | +| Plate | 3/5 | There are other configurations but these are the most common. If you are interested in others check out the wikipedia link given above. Most of these will not correctly function in ACE3 though due to additional variables for the equation. @@ -97,18 +97,18 @@ There are other configurations but these are the most common. If you are interes There are different types of fragmentation fragments to choose from, and they can be defined in this config value. -| Type -| ---- -| ACE_frag_tiny -| ACE_frag_tiny_HD -| ACE_frag_small -| ACE_frag_small_HD -| ACE_frag_medium -| ACE_frag_medium_HD -| ACE_frag_large -| ACE_frag_large_HD -| ACE_frag_huge -| ACE_frag_huge_HD +| Type | +| ------------------ | +| ACE_frag_tiny | +| ACE_frag_tiny_HD | +| ACE_frag_small | +| ACE_frag_small_HD | +| ACE_frag_medium | +| ACE_frag_medium_HD | +| ACE_frag_large | +| ACE_frag_large_HD | +| ACE_frag_huge | +| ACE_frag_huge_HD | The tinier the piece of fragmentation the shorter the distance of travel. The `_HD` variants are all even higher drag versions. Grenades generally should use the `_HD` variants. Experimentation here is important. diff --git a/docs/wiki/framework/goggles-framework.md b/docs/wiki/framework/goggles-framework.md index 1b9b27588b..07840ebf95 100644 --- a/docs/wiki/framework/goggles-framework.md +++ b/docs/wiki/framework/goggles-framework.md @@ -34,7 +34,7 @@ class CfgGlasses { ### 2.1 Listenable -Event Name | Description | Passed Parameter(s) | Locality ----------- | ----------- | ------------------- | -------- -`ace_glassesChanged` | Glasses Changed | `[_unit, _glassesClass]` | Local -`ace_glassesCracked` | Glasses Cracked | `[_unit]` | Local +| Event Name | Description | Passed Parameter(s) | Locality | +| ---------- | ----------- | ------------------- | -------- | +| `ace_glassesChanged` | Glasses Changed | `[_unit, _glassesClass]` | Local | +| `ace_glassesCracked` | Glasses Cracked | `[_unit]` | Local | diff --git a/docs/wiki/framework/grenades-framework.md b/docs/wiki/framework/grenades-framework.md index a0b0ceeea7..3fed8fd50a 100644 --- a/docs/wiki/framework/grenades-framework.md +++ b/docs/wiki/framework/grenades-framework.md @@ -68,3 +68,13 @@ The average amount of time in seconds, after `explosionTime` has passed, between ### 2.4 ace_grenades_flashbangIntervalMaxDeviation The amount of randomness in the fuse time. + +## 3. Events + +### 3.1 Listenable + +| Event Name | Description | Passed Parameter(s) | Locality | +| ---------- | ----------- | ------------------- | -------- | +| `ace_flashbangExploded` | A flashbang exploded | `[_grenadePosASL]` | Global | +| `ace_grenades_flashbangedAI` | A local AI was affected by a flashbang | `[_unit, _strength, _grenadePosASL]` | Local | +| `ace_grenades_flashbangedPlayer` | The local player was affected by a flashbang | `[_strength, _grenadePosASL]` | Local | diff --git a/docs/wiki/framework/interactionMenu-framework.md b/docs/wiki/framework/interactionMenu-framework.md index 68e49414e2..fb66fb3918 100644 --- a/docs/wiki/framework/interactionMenu-framework.md +++ b/docs/wiki/framework/interactionMenu-framework.md @@ -40,21 +40,25 @@ class CfgVehicles { exceptions[] = {}; statement = "_player switchMove 'TestDance'"; icon = "\z\dance.paa"; + }; + }; + }; +}; ``` -Config Name | Type | Description ----------- | ----------- | ------------------- -`displayName` | String | Text shown to user -`condition` | String (of code) | Condition to show the action -`statement` | String (of code) | Statement run when selected -`icon` | String (file path) | Icon shown (OPTIONAL) -`exceptions` | Array (of strings) | Exceptions to `canInteractWith` conditions (e.g. `"notOnMap"`) (OPTIONAL) -`insertChildren` | String (of code) | Code to return sub actions (OPTIONAL) -`modifierFunction` | String (of code) | Code to modify this action (OPTIONAL) -`runOnHover` | Number or String | (1=true) OR Condition code - Will run the statement on hover (OPTIONAL) -`distance` | Number | External Base Actions Only, Max distance player can be from action point -`position` | String (of code) | External Base Actions Only, Code to return a position in model cords (priority over `selection`) -`selection` | String | External Base Actions Only, A memory point for `selectionPosition` +| Config Name | Type | Description | +| ---------- | ----------- | ------------------- | +| `displayName` | String | Text shown to user | +| `condition` | String (of code) | Condition to show the action | +| `statement` | String (of code) | Statement run when selected | +| `icon` | String (file path) | Icon shown (OPTIONAL) | +| `exceptions` | Array (of strings) | Exceptions to `canInteractWith` conditions (e.g. `"notOnMap"`) (OPTIONAL) | +| `insertChildren` | String (of code) | Code to return sub actions (OPTIONAL) | +| `modifierFunction` | String (of code) | Code to modify this action (OPTIONAL) | +| `runOnHover` | Number or String | (1=true) OR Condition code - Will run the statement on hover (OPTIONAL) | +| `distance` | Number | External Base Actions Only, Max distance player can be from action point | +| `position` | String (of code) | External Base Actions Only, Code to return a position in model cords (priority over `selection`) | +| `selection` | String | External Base Actions Only, A memory point for `selectionPosition` | Actions can be inserted anywhere on the config tree, e.g. hearing's earplugs is a sub action of `ACE_Equipment`: @@ -62,7 +66,10 @@ Actions can be inserted anywhere on the config tree, e.g. hearing's earplugs is class CAManBase: Man { class ACE_SelfActions { class ACE_Equipment { - class ACE_PutInEarplugs { + class ACE_PutInEarplugs {}; + }; + }; +}; ``` ## 3. Adding actions via scripts @@ -233,7 +240,7 @@ This is the ideal way to add self interaction actions, as adding them via `addAc params ["_type"]; // string of the object's classname if (!(_type isKindOf "Car")) exitWith {}; if ((getNumber (configFile >> "CfgVehicles" >> _type >> "side")) != 3) exitWith {}; - + private _action = ["playRadio","Play Radio","",{playMusic "NeverGonnaGiveYouUp"},{true}] call ace_interact_menu_fnc_createAction; [_type, 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; }] call CBA_fnc_addEventHandler; diff --git a/docs/wiki/framework/laser-framework.md b/docs/wiki/framework/laser-framework.md new file mode 100644 index 0000000000..fef12a4760 --- /dev/null +++ b/docs/wiki/framework/laser-framework.md @@ -0,0 +1,34 @@ +--- +layout: wiki +title: Laser +description: Explains the functions available for laser designators. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 16 + patch: 4 +--- + +## 1. Scripting + +### 1.1. Get object's laser code + +`ace_laser_fnc_getLaserCode` + +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Unit/Vehicle | Object | Required | +| **R** | Laser code | Number | Return value | + +### 1.2. Set object's laser code + +`ace_laser_fnc_setLaserCode` + +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Unit/Vehicle | Object | Required | +| 1 | Laser code | Number | Required | +| **R** | None | None | Return value | diff --git a/docs/wiki/framework/medical-framework.md b/docs/wiki/framework/medical-framework.md index 834eeced80..00d9133b00 100644 --- a/docs/wiki/framework/medical-framework.md +++ b/docs/wiki/framework/medical-framework.md @@ -219,23 +219,23 @@ Custom wound handlers should follow the same spec as the built-in handler: `ace_medical_damage_fnc_woundsHandlerBase` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Unit that was hit | Object | Required -1 | Array of damage dealt to each body part | Array | Required -2 | Type of damage | String | Required -**R** | Parameters to be passed to the next handler in the list, e.g. `_this` or a modified copy of it. Return `[]` to prevent further handling. | Array | Required +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Unit that was hit | Object | Required | +| 1 | Array of damage dealt to each body part | Array | Required | +| 2 | Type of damage | String | Required | +| **R** | Parameters to be passed to the next handler in the list, e.g. `_this` or a modified copy of it. Return `[]` to prevent further handling. | Array | Required | The damage elements are sorted in descending order according to how much damage was dealt to each body part _before armor was taken into account_, but the actual damage values are _after armor_. ### Example `[player, [[0.5, "Body", 1], [0.3, "Head", 0.6]], "grenade"] ace_medical_damage_fnc_woundsHandlerBase` - | Arguments | Explanation ----| --------- | ----------- -0 | `player` | Unit that was hit -1 | `[[0.5, "Body", 1], [0.3, "Head", 0.6]]` | 0.5 damage to body (was 1 before armor), 0.3 damage to head (was 0.6 before armor) -2 | `"grenade"` | type grenade (non-selection-specific) +| | Arguments | Explanation | +| ---| --------- | ----------- | +| 0 | `player` | Unit that was hit | +| 1 | `[[0.5, "Body", 1], [0.3, "Head", 0.6]]` | 0.5 damage to body (was 1 before armor), 0.3 damage to head (was 0.6 before armor) | +| 2 | `"grenade"` | type grenade (non-selection-specific) | ## 5. Tweaking internal variables Some of ACE Medical's underlying behavior, primarily related to damage handling and the vitals loop, can be fine-tuned by editing `ace_medical_const_` variables, found in [script_macros_medical.hpp](https://github.com/acemod/ACE3/blob/master/addons/medical_engine/script_macros_medical.hpp). diff --git a/docs/wiki/framework/medical-treatment-framework.md b/docs/wiki/framework/medical-treatment-framework.md index e42cb21e3b..736295804a 100644 --- a/docs/wiki/framework/medical-treatment-framework.md +++ b/docs/wiki/framework/medical-treatment-framework.md @@ -57,9 +57,60 @@ class ACE_Medical_Treatment_Actions { }; ``` -## 2. Mission Variables +## 2. Medical Vehicles and Facilities -### 2.1 Grave Digging Object Configuration +### 2.1 Medical Vehicles + +To configure a vehicle as a Medical Vehicle by default, set the `attendant` property in the vehicle's config to `1`. +```cpp +class CfgVehicles { + class MyAmbulance { + attendant = 1; + }; +}; +``` +To set a vehicle as a Medical Vehicle mid-mission, set the `ace_medical_isMedicalVehicle` variable globally. +```sqf +// Sets the object behind your cursor to be a medical vehicle +cursorObject setVariable ["ace_medical_isMedicalVehicle", true, true]; + +// Create an interaction to turn a vehicle into a medical vehicle +private _statement = {_target setVariable ["ace_medical_isMedicalVehicle", true, true]}; +private _action = ["TAG_makeMedicalVehicle", "Set as Medical Vehicle", _statement, {!([_target] call ace_medical_treatment_fnc_isMedicalVehicle)}] call ace_interact_menu_fnc_createAction; +[cursorObject, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_createAction; + +// Set all vehicles of type "B_Truck_01_transport_F" as medical vehicles +private _classname = "B_Truck_01_transport_F"; +private _affectChildClasses = false; // Affect variants of this vehicle +["B_Truck_01_transport_F", "InitPost", { + params ["_vehicle"]; + if (!local _vehicle) exitWith {}; + _vehicle setVariable ["ace_medical_isMedicalVehicle", true, true]; +}, _affectChildClasses, [], true] call CBA_fnc_addClassEventHandler; +``` + +### 2.2 Medical Facilities + +To configure an object as a Medical Facility by default, add a new array containing its classname to the `ace_medical_facilities` class in config root. +```cpp +class CfgVehicles { + class ThingX; + class MyMedicalFacility: ThingX {}; + class MyMedicalFacility2_ElectricBoogaloo: MyMedicalFacility {}; +}; + +class ace_medical_facilities { + TAG_allOfMyFacilities[] = {"MyMedicalFacility", "MyMedicalFacility2_ElectricBoogaloo"}; +}; +``` +To set an object as a Medical Facility mid-mission, set the `ace_medical_isMedicalFacility` variable globally. See above. + + +Both Medical Facilities and Medical Vehicles can also be created via the Eden Editor's attributes menu. + +## 3. Mission Variables + +### 3.1 Grave Digging Object Configuration The object created when digging a grave can be modified by setting the `ace_medical_treatment_graveClassname` variable. ```sqf @@ -71,7 +122,9 @@ The object's rotation can also be modified, if necessary. ace_medical_treatment_graveRotation = 0; // rotation angle (will depend on model classname) ``` -### 2.2 Zeus Medical Menu Module +### 3.2 Zeus Medical Menu Module If a mission maker wishes to disable Zeus access to the medical menu, they can set the variable below: +```sqf ace_medical_gui_enableZeusModule = false; // default is true +``` diff --git a/docs/wiki/framework/missile-guidance-framework.md b/docs/wiki/framework/missile-guidance-framework.md index 3b31975da3..ff6859d735 100644 --- a/docs/wiki/framework/missile-guidance-framework.md +++ b/docs/wiki/framework/missile-guidance-framework.md @@ -117,6 +117,6 @@ class ace_missileguidance_attackProfiles { ### 5.1 Listenable -Event Name | Description | Passed Parameter(s) | Locality ----------- | ----------- | ------------------- | -------- -`ace_missileguidance_handoff` | Missile handed off | `[_target, _args]` | Global +| Event Name | Description | Passed Parameter(s) | Locality | +| ---------- | ----------- | ------------------- | -------- | +| `ace_missileguidance_handoff` | Missile handed off | `[_target, _args]` | Global | diff --git a/docs/wiki/framework/overpressure-framework.md b/docs/wiki/framework/overpressure-framework.md index 7e7969f62a..243157c186 100644 --- a/docs/wiki/framework/overpressure-framework.md +++ b/docs/wiki/framework/overpressure-framework.md @@ -46,6 +46,6 @@ class CfgWeapons { ### 2.1 Listenable -Event Name | Description | Passed Parameter(s) | Locality ----------- | ----------- | ------------------- | -------- -`ace_overpressure` | Overpressure damage inflicted | `[_firer, _posASL, _direction, _weapon, _magazine, _ammo]` | Target +| Event Name | Description | Passed Parameter(s) | Locality | +| ---------- | ----------- | ------------------- | -------- | +| `ace_overpressure` | Overpressure damage inflicted | `[_firer, _posASL, _direction, _weapon, _magazine, _ammo]` | Target | diff --git a/docs/wiki/framework/rearm-framework.md b/docs/wiki/framework/rearm-framework.md index 7f899f54c9..a4061cb2bc 100644 --- a/docs/wiki/framework/rearm-framework.md +++ b/docs/wiki/framework/rearm-framework.md @@ -71,31 +71,31 @@ Meant to run on server only. `ace_rearm_fnc_makeSource` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -1 | Supply Count | Number | Optional (default: `0`) -1 | Add (`true`) or set (`false`) supply | Bool | Optional (default: `false`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| 1 | Supply Count | Number | Optional (default: `0`) | +| 1 | Add (`true`) or set (`false`) supply | Bool | Optional (default: `false`) | +| **R** | None | None | Return value | #### 3.1.1 Example `[cursorObject, 1200] call ace_rearm_fnc_makeSource` - | Arguments | Explanation ----| --------- | ----------- -0 | `cursorObject` | Rearm source object -1 | `1200` | Ammo supply +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `cursorObject` | Rearm source object | +| 1 | `1200` | Ammo supply | ### 3.2 Enabling / disabling rearming `ace_rearm_fnc_disable` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -1 | Disable rearming, true to disable, false to enable | Boolean | Optional (default: `true`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| 1 | Disable rearming, true to disable, false to enable | Boolean | Optional (default: `true`) | +| **R** | None | None | Return value | This function disables rearming for all supported turrets of a vehicle. @@ -103,9 +103,9 @@ This function disables rearming for all supported turrets of a vehicle. `[tank] call ace_rearm_fnc_disable;` - | Arguments | Explanation ----| --------- | ----------- -0 | `tank` | My object +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `tank` | My object | Disables rearming on the object `tank`. @@ -113,10 +113,10 @@ Disables rearming on the object `tank`. `[tank, false] call ace_rearm_fnc_disable;` - | Arguments | Explanation ----| --------- | ----------- -0 | `tank` | My object -1 | `false`| Rearming is enabled +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `tank` | My object | +| 1 | `false` | Rearming is enabled | Enables rearming on the object `tank`. @@ -124,10 +124,10 @@ Enables rearming on the object `tank`. `ace_rearm_fnc_getSupplyCount` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -**R** | Supply count | Number | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| **R** | Supply count | Number | Return value | This function returns the current supply count of the ammo truck. @@ -135,9 +135,9 @@ This function returns the current supply count of the ammo truck. `[ammo_truck] call ace_rearm_fnc_getSupplyCount;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My object +| | Arguments | Explanation | +| ---| ------------- | ----------- | +| 0 | `ammo_truck` | My object | The remaining supply count of `ammo_truck` will be returned. @@ -145,11 +145,11 @@ The remaining supply count of `ammo_truck` will be returned. `ace_rearm_fnc_setSupplyCount` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -1 | Supply Count | Boolean | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| 1 | Supply Count | Boolean | Required | +| **R** | None | None | Return value | This function sets the current supply count of the ammo truck. It can be used to replenish the ammo truck on `Limited ammo supply based on caliber` setting. @@ -157,21 +157,21 @@ This function sets the current supply count of the ammo truck. It can be used to `[ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My ammo truck object -1 | `1000`| Supply Count +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `ammo_truck` | My ammo truck object | +| 1 | `1000`| Supply Count | ### 3.5 Adding specific magazines `ace_rearm_fnc_addMagazineToSupply` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -1 | Magazine Classname | String | Required -2 | Only add content of one ammo box | Boolean | Optional (default: `false`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| 1 | Magazine Classname | String | Required | +| 2 | Only add content of one ammo box | Boolean | Optional (default: `false`) | +| **R** | None | None | Return value | This function is most useful with the module setting `Only specific Magazines`. Note that this function only adds one magazine of a specific class. Other magazines of the same size are not available on this module setting. It has to be used to replenish the ammo truck on `Only specific Magazines` setting. @@ -181,10 +181,10 @@ This function can also be used to increase the supply count on setting `Limited `[ammo_truck, "32Rnd_155mm_Mo_shells"] call ace_rearm_fnc_addMagazineToSupply;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My ammo truck object -1 | `"32Rnd_155mm_Mo_shells"` | Some magazine class +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `ammo_truck` | My ammo truck object | +| 1 | `"32Rnd_155mm_Mo_shells"` | Some magazine class | The 32 artillery shells are added to the supply count or the magazine storage of the specified ammo truck. @@ -192,11 +192,11 @@ The 32 artillery shells are added to the supply count or the magazine storage of `ace_rearm_fnc_addVehicleMagazinesToSupply` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -1 | Any vehicle object or class name | Object or String | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| 1 | Any vehicle object or class name | Object or String | Required | +| **R** | None | None | Return value | This function wraps `ace_rearm_fnc_addMagazineToSupply` and uses it to add all default magazines of all supported turrets of the vehicle to the ammo truck. @@ -204,10 +204,10 @@ This function wraps `ace_rearm_fnc_addMagazineToSupply` and uses it to add all d `[ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My ammo truck object -1 | `tank`| A vehicle object +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `ammo_truck` | My ammo truck object | +| 1 | `tank`| A vehicle object | All magazines found in the class config of the object `tank` are made available. @@ -215,10 +215,10 @@ All magazines found in the class config of the object `tank` are made available. `[ammo_truck, "B_MBT_01_arty_F"] call ace_rearm_fnc_addVehicleMagazinesToSupply;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My ammo truck object -1 | `"B_MBT_01_arty_F"`| Vehicle class name +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `ammo_truck` | My ammo truck object | +| 1 | `"B_MBT_01_arty_F"`| Vehicle class name | All magazines found in the config of the vehicle class `B_MBT_01_arty_F` are made available. @@ -227,21 +227,21 @@ All magazines found in the config of the vehicle class `B_MBT_01_arty_F` are mad `ace_rearm_fnc_removeMagazineFromSupply` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Ammo Truck | Object | Required -1 | Magazine Classname | String | Required -2 | Number of Rounds to withdraw | Number | Optional (default: `-1`) -**R** | Magazine could be removed successfully | Boolean | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Ammo Truck | Object | Required | +| 1 | Magazine Classname | String | Required | +| 2 | Number of Rounds to withdraw | Number | Optional (default: `-1`) | +| **R** | Magazine could be removed successfully | Boolean | Return value | #### 3.7.1 Example 1 `[ammo_truck, "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_removeMagazineFromSupply;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My ammo truck object -1 | `"500Rnd_127x99_mag_Tracer_Red"`| Carrying is enabled +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `ammo_truck` | My ammo truck object | +| 1 | `"500Rnd_127x99_mag_Tracer_Red"`| Carrying is enabled | Removes one ammo box worth of "500Rnd_127x99_mag_Tracer_Red" from the supply. Depending on the module setting the ammo box does hold an entire magazine or only the caliber based amount of rounds. @@ -249,16 +249,16 @@ Removes one ammo box worth of "500Rnd_127x99_mag_Tracer_Red" from the supply. De `[ammo_truck, "500Rnd_127x99_mag_Tracer_Red", 50] call ace_rearm_fnc_removeMagazineFromSupply;` - | Arguments | Explanation ----| --------- | ----------- -0 | `ammo_truck` | My ammo truck object -1 | `"500Rnd_127x99_mag_Tracer_Red"`| Carrying is enabled -2 | `50` | Number of rounds +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `ammo_truck` | My ammo truck object | +| 1 | `"500Rnd_127x99_mag_Tracer_Red"`| Carrying is enabled | +| 2 | `50` | Number of rounds | Removes one ammo box with 50 rounds of 500Rnd_127x99_mag_Tracer_Red from the supply. This is 10% of the supply of an entire magazine. ## 4. Events -| Name | Arguments | Global? | Added in | -| ------------- | ------------- | ------------- | -| ace_rearm_sourceInitalized | Yes | Ammo truck (OBJECT) | 3.16.0 | +| Name | Arguments | Global? | Added in | +| ------------- | --------- | ------- | -------- | +| `ace_rearm_sourceInitalized` | Ammo truck (OBJECT) | Yes | 3.16.0 | diff --git a/docs/wiki/framework/refuel-framework.md b/docs/wiki/framework/refuel-framework.md index c91c8cb6e3..325606a970 100644 --- a/docs/wiki/framework/refuel-framework.md +++ b/docs/wiki/framework/refuel-framework.md @@ -45,57 +45,57 @@ Meant to be called on server only. `ace_refuel_fnc_makeSource` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Fuel Source | Object | Required -1 | Amount (in liters) | Number | Optional (default: `0`) -2 | Hooks positions | Array | Optional (default: `[[0,0,0]]`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Fuel Source | Object | Required | +| 1 | Amount (in liters) | Number | Optional (default: `0`) | +| 2 | Hooks positions | Array | Optional (default: `[[0,0,0]]`) | +| **R** | None | None | Return value | #### 2.1.1 Example `[cursorObject, 100] call ace_refuel_fnc_makeSource` - | Arguments | Explanation ----| --------- | ----------- -0 | `cursorObject` | Fuel source object -1 | `100` | Fuel amount (in liters) +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `cursorObject` | Fuel source object | +| 1 | `100` | Fuel amount (in liters) | ### 2.2 Getting the fuel supply `ace_refuel_fnc_getFuel` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Fuel Truck | Object | Required -**R** | Fuel amount left (in liters) | Number | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Fuel Truck | Object | Required | +| **R** | Fuel amount left (in liters) | Number | Return value | #### 2.2.1 Example `[fuelTruck] call ace_refuel_fnc_getFuel;` - | Arguments | Explanation ----| --------- | ----------- -0 | `fuelTruck` | My fuel truck object +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `fuelTruck` | My fuel truck object | ### 2.3 Setting the fuel supply `ace_refuel_fnc_setFuel` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Fuel Truck | Object | Required -1 | Amount (in liters) | Number | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +| ---| --------- | ---- | ------------------------ | +| 0 | Fuel Truck | Object | Required | +| 1 | Amount (in liters) | Number | Required | +| **R** | None | None | Return value | #### 2.3.1 Example `[fuelTruck, 428] call ace_refuel_fnc_setFuel;` - | Arguments | Explanation ----| --------- | ----------- -0 | `fuelTruck` | Fuel truck object -1 | `428` | New fuel amount (in liters) +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `fuelTruck` | Fuel truck object | +| 1 | `428` | New fuel amount (in liters) | ### 2.4 Make a jerry can @@ -103,19 +103,19 @@ Meant to be run on all clients and server. `ace_refuel_fnc_makeJerryCan` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Jerry Can | Object | Required -1 | Amount (in liters) | Number | Optional (default: `20`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Jerry Can | Object | Required | +| 1 | Amount (in liters) | Number | Optional (default: `20`) | +| **R** | None | None | Return value | #### 2.4.1 Example 1 `[can] call ace_refuel_fnc_makeJerryCan;` - | Arguments | Explanation ----| --------- | ----------- -0 | `can` | Jerry can object +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `can` | Jerry can object | The jerry can will have the default 20 liters volume. @@ -123,16 +123,16 @@ The jerry can will have the default 20 liters volume. `[can, 200] call ace_refuel_fnc_makeJerryCan;` - | Arguments | Explanation ----| --------- | ----------- -0 | `can` | Jerry can object -1 | `200` | Amount (in liters) +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `can` | Jerry can object | +| 1 | `200` | Amount (in liters) | The jerry can will now have a volume of 200 liters. ## 3. Events | Name | Arguments | Global? | Added in | -| ------------- | ------------- | ------------- | +| ------------- | ------------- | ----- | ------------- | | ace_refuel_sourceInitialized | Fuel source (OBJECT), items (BOOL or ARRAY) | Yes | 3.16.0 | | ace_refuel_jerryCanInitalized | Jerry can (OBJECT) | Yes | 3.16.0 | diff --git a/docs/wiki/framework/reloadlaunchers-framework.md b/docs/wiki/framework/reloadlaunchers-framework.md index d055cc533c..074dc09ff0 100644 --- a/docs/wiki/framework/reloadlaunchers-framework.md +++ b/docs/wiki/framework/reloadlaunchers-framework.md @@ -26,6 +26,6 @@ class CfgWeapons { ### 2.1 Listenable -Event Name | Description | Passed Parameter(s) | Locality ----------- | ----------- | ------------------- | -------- -`ace_reloadlaunchers_reloadLauncher` | Launcher reloaded | `[_unit, _target, _weapon, _magazine]` | Target +| Event Name | Description | Passed Parameter(s) | Locality | +| ---------- | ----------- | ------------------- | -------- | +| `ace_reloadlaunchers_reloadLauncher` | Launcher reloaded | `[_unit, _target, _weapon, _magazine]` | Target | diff --git a/docs/wiki/framework/slideshow-framework.md b/docs/wiki/framework/slideshow-framework.md index 0697116039..575a81420c 100644 --- a/docs/wiki/framework/slideshow-framework.md +++ b/docs/wiki/framework/slideshow-framework.md @@ -32,16 +32,16 @@ Important notes: `ace_slideshow_fnc_createSlideshow` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Screen Objects | Array | Required -1 | Controller Objects | Array | Required (screen objects are used if empty `[]`, none are available with automatic transitions) -2 | Image Paths | Array | Required (paths must use backslash `\`) -3 | Action Names | Array | Required -4 | Slide Duration | Number | Optional (default: `0`, `0` disables automatic transitions) -5 | Set Name | String | Optional (default: localized `"Slides"`) -6 | Texture Selection | Number | Optional (default: `0`) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Screen Objects | Array | Required | +| 1 | Controller Objects | Array | Required (screen objects are used if empty `[]`, none are available with automatic transitions) | +| 2 | Image Paths | Array | Required (paths must use backslash `\`) | +| 3 | Action Names | Array | Required | +| 4 | Slide Duration | Number | Optional (default: `0`, `0` disables automatic transitions) | +| 5 | Set Name | String | Optional (default: localized `"Slides"`) | +| 6 | Texture Selection | Number | Optional (default: `0`) | +| **R** | None | None | Return value | _Note: Set Name argument added in 3.9.1._ @@ -49,15 +49,15 @@ _Note: Set Name argument added in 3.9.1._ `[[object1, object2], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5, "My Slides", 1] call ace_slideshow_fnc_createSlideshow;` - | Arguments | Explanation ----| --------- | ----------- -0 | `[object1, object2]` | Objects on which images will be projected on -1 | `[controller1]` | Objects with which slideshow can be controlled -2 | `["images\image1.paa", "images\image2.paa"]` | Paths to images projected on screen objects -3 | `["Action1", "Action2"]` | Action names for interaction menu if automatic transitions are not enabled -4 | `5` | 5s slide duration before change to next image -5 | `"My Slides"` | Main interaction point name, for easier distinguishing of multiple slideshow sets -6 | `1` | Uses texture selection 1 for objects with multiple options +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `[object1, object2]` | Objects on which images will be projected on | +| 1 | `[controller1]` | Objects with which slideshow can be controlled | +| 2 | `["images\image1.paa", "images\image2.paa"]` | Paths to images projected on screen objects | +| 3 | `["Action1", "Action2"]` | Action names for interaction menu if automatic transitions are not enabled | +| 4 | `5` | 5s slide duration before change to next image | +| 5 | `"My Slides"` | Main interaction point name, for easier distinguishing of multiple slideshow sets | +| 6 | `1` | Uses texture selection 1 for objects with multiple options | ### 2.2 Create Map Images @@ -86,7 +86,7 @@ _Note: Set Name argument added in 3.9.1._ tex1 = [] call ace_slideshow_fnc_mapImage; tex2 = [(getPos aWhiteboard), 0.5, [[getpos aWhiteboard, "you", "mil_start"]], 0] call ace_slideshow_fnc_mapImage; tex3 = [[4000, 4000], 0.5, [[[5000, 5000], "target", "mil_objective"]], 2] call ace_slideshow_fnc_mapImage; -[[aWhiteboard], [], [tex1, tex2, tex3], ["Full", "Sat Start", "Sat Objective"]] call ace_slideshow_fnc_createSlideshow; +[[aWhiteboard], [], [tex1, tex2, tex3], ["Full", "Sat Start", "Sat Objective"]] call ace_slideshow_fnc_createSlideshow; ``` ### 2.2.2 Map Slideshow Advanced Example @@ -105,12 +105,12 @@ private _initCode = { [{ params ["_displayID","_idPFH"]; private _display = findDisplay _displayID; - if (isNull _display) exitWith { + if (isNull _display) exitWith { systemChat format ["%1 - removing pfeh", _this]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; displayUpdate _display; - + private _map = _display displayCtrl 1; _map ctrlMapAnimAdd [0, 0.3, getpos theUAV]; ctrlMapAnimCommit _map; diff --git a/docs/wiki/framework/spectator-framework.md b/docs/wiki/framework/spectator-framework.md index 22bc0c0021..c78285b98b 100644 --- a/docs/wiki/framework/spectator-framework.md +++ b/docs/wiki/framework/spectator-framework.md @@ -48,11 +48,11 @@ Note that these settings govern the default spectator behaviour. Through the use ### 3.1 Listenable -Event Name | Passed Parameter(s) | Locality | Description ----------- | ----------- | ------------------- | -------- -`ace_spectatorSet` | [_isSpectator, _player] | Global | Player's spectator status was changed -`ace_spectator_displayLoaded` | _display | Local | Spectator display was loaded -`ace_spectator_displayUnloaded` | _display | Local | Spectator display was unloaded +| Event Name | Passed Parameter(s) | Locality | Description | +| ---------- | ----------- | ------------------- | -------- | +| `ace_spectatorSet` | [_isSpectator, _player] | Global | Player's spectator status was changed | +| `ace_spectator_displayLoaded` | _display | Local | Spectator display was loaded | +| `ace_spectator_displayUnloaded` | _display | Local | Spectator display was unloaded | ## 4. Scripting diff --git a/docs/wiki/framework/tagging-framework.md b/docs/wiki/framework/tagging-framework.md index e263a2afaa..126971abf5 100644 --- a/docs/wiki/framework/tagging-framework.md +++ b/docs/wiki/framework/tagging-framework.md @@ -41,28 +41,28 @@ class ACE_Tags { `ace_tagging_fnc_addCustomTag` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Unique Identifier | String | Required -1 | Display Name | String | Required -2 | Required Item | String | Required -3 | Textures | Array | Required -4 | Icon | String | Optional (default: `""` - Default white point) -5 | Material Paths | Array | Optional (default: `[]] - No custom material) -6 | Tag Model | String | Optional (default: `"UserTexture1m_F"` - 1x1m texture surface) -**R** | Successfully Added Tag | Boolean | Return value +| | Arguments | Type | Optional (default value) | +| ---| --------- | ---- | ------------------------ | +| 0 | Unique Identifier | String | Required | +| 1 | Display Name | String | Required | +| 2 | Required Item | String | Required | +| 3 | Textures | Array | Required | +| 4 | Icon | String | Optional (default: `""` - Default white point) | +| 5 | Material Paths | Array | Optional (default: `[]` - No custom material) | +| 6 | Tag Model | String | Optional (default: `"UserTexture1m_F"` - 1x1m texture surface) | +| **R** | Successfully Added Tag | Boolean | Return value | #### 2.1.1 Example `["ace_victoryRed", "Victory Red", "ACE_SpraypaintRed", ["tagTexture1.paa", "tagTexture2.paa"], "icon.paa"] call ace_tagging_fnc_addCustomTag;` - | Arguments | Explanation ----| --------- | ----------- -0 | `"ace_victoryRed"` | Unique identifier (similar to class name) -1 | `"Victory Red"` | Name of your tag being displayed in the interaction menu -2 | `"ACE_SpraypaintRed"` | Required item to have in the inventory to be able to spray your tag -3 | `["tagTexture1.paa", "tagTexture2.paa"]` | List of texture variants (one is randomly selected when tagging) -4 | `"icon.paa"` | Icon being displayed in the interaction menu +| | Arguments | Explanation | +| ---| --------- | ----------- | +| 0 | `"ace_victoryRed"` | Unique identifier (similar to class name) | +| 1 | `"Victory Red"` | Name of your tag being displayed in the interaction menu | +| 2 | `"ACE_SpraypaintRed"` | Required item to have in the inventory to be able to spray your tag | +| 3 | `["tagTexture1.paa", "tagTexture2.paa"]` | List of texture variants (one is randomly selected when tagging) | +| 4 | `"icon.paa"` | Icon being displayed in the interaction menu | ### 2.2 Tags in description.ext diff --git a/docs/wiki/framework/trenches-framework.md b/docs/wiki/framework/trenches-framework.md index 5fc2dc636e..40e83689ba 100644 --- a/docs/wiki/framework/trenches-framework.md +++ b/docs/wiki/framework/trenches-framework.md @@ -30,7 +30,7 @@ class CfgSurfaces { ```cpp class CfgWeapons { // same config also works on backpacks (CfgVehicles) class yourBaseClass; - class yourEntrenchingToolClass: yourBaseClass + class yourEntrenchingToolClass: yourBaseClass { ace_trenches_entrenchingTool = 1; }; }; diff --git a/docs/wiki/framework/ui-framework.md b/docs/wiki/framework/ui-framework.md index af391f36d5..3b6ec08951 100644 --- a/docs/wiki/framework/ui-framework.md +++ b/docs/wiki/framework/ui-framework.md @@ -53,21 +53,21 @@ Adding new elements through scripting is currently not possible. `ace_ui_fnc_setElementVisibility` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Source | String | Required -1 | Set/Unset | Boolean | Required -2 | Element Name | String | Required -3 | Show/Hide | Boolean | Optional (default: `false`) -**R** | Successfully Modified | Boolean | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Source | String | Required | +| 1 | Set/Unset | Boolean | Required | +| 2 | Element Name | String | Required | +| 3 | Show/Hide | Boolean | Optional (default: `false`) | +| **R** | Successfully Modified | Boolean | Return value | #### 2.1.1 Example `["ace_reload", true, "ammoCount", false] call ace_ui_fnc_setElementVisibility;` - | Arguments | Explanation ----| --------- | ----------- -0 | `"ace_reload"` | Source displayed in hint when trying to edit this element from in-game settings or in RPT when some other source tries to edit it -1 | `true` | Set element, preventing others to change it (except config, which always has priority) -2 | `"ammoCount"` | Element name to modify -3 | `false` | Hide the element +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `"ace_reload"` | Source displayed in hint when trying to edit this element from in-game settings or in RPT when some other source tries to edit it | +| 1 | `true` | Set element, preventing others to change it (except config, which always has priority) | +| 2 | `"ammoCount"` | Element name to modify | +| 3 | `false` | Hide the element | diff --git a/docs/wiki/framework/vehiclelock-framework.md b/docs/wiki/framework/vehiclelock-framework.md index 8dc1aea2cf..d882cab971 100644 --- a/docs/wiki/framework/vehiclelock-framework.md +++ b/docs/wiki/framework/vehiclelock-framework.md @@ -31,22 +31,22 @@ Sync the module with vehicles and players. Custom keys will be handed to players `ace_vehiclelock_fnc_addKeyForVehicle` - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Unit | Object | Required -1 | Vehicle | Object | Required -2 | Use Custom Key | Boolean | Optional (default: `false`, `false` for side key, `true` for custom key) -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Unit | Object | Required | +| 1 | Vehicle | Object | Required | +| 2 | Use Custom Key | Boolean | Optional (default: `false`, `false` for side key, `true` for custom key) | +| **R** | None | None | Return value | #### 3.1.1 Example `[bob, car1, true] call ace_vehiclelock_fnc_addKeyForVehicle;` - | Arguments | Explanation ----| --------- | ----------- -0 | `bob` | Unit the key will be added to -1 | `car1` | Vehicle the key will work on -2 | `true` | Set custom key +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `bob` | Unit the key will be added to | +| 1 | `car1` | Vehicle the key will work on | +| 2 | `true` | Set custom key | ### 3.2 Override Side diff --git a/docs/wiki/framework/vehicles-framework.md b/docs/wiki/framework/vehicles-framework.md index a1f66e807a..dac52d0cfa 100644 --- a/docs/wiki/framework/vehicles-framework.md +++ b/docs/wiki/framework/vehicles-framework.md @@ -38,18 +38,18 @@ class CfgVehicles { `ace_vehicles_fnc_setVehicleStartDelay` Has global effects. - | Arguments | Type | Optional (default value) ----| --------- | ---- | ------------------------ -0 | Vehicle | Object | Required -1 | Delay (in seconds) | Number | Required -**R** | None | None | Return value +| | Arguments | Type | Optional (default value) | +|----| --------- | ---- | ------------------------ | +| 0 | Vehicle | Object | Required | +| 1 | Delay (in seconds) | Number | Required | +| **R** | None | None | Return value | #### 1.2.1 Example `[myCar, 2.2] call ace_vehicles_fnc_setVehicleStartDelay;` - | Arguments | Explanation ----| --------- | ----------- -0 | `myCar` | My car object -1 | `2.2` | New startup delay +| | Arguments | Explanation | +|----| --------- | ----------- | +| 0 | `myCar` | My car object | +| 1 | `2.2` | New startup delay | diff --git a/docs/wiki/framework/wirecutter-framework.md b/docs/wiki/framework/wirecutter-framework.md index 3f2a97c0b1..65a4ed1f98 100644 --- a/docs/wiki/framework/wirecutter-framework.md +++ b/docs/wiki/framework/wirecutter-framework.md @@ -36,6 +36,6 @@ class CfgVehicles { ### 2.1 Listenable -Event Name | Description | Passed Parameter(s) | Locality ----------- | ----------- | ------------------- | -------- -`ace_wireCuttingStarted` | Wire cutting started | `[_unit, _fence]` | Global +| Event Name | Description | Passed Parameter(s) | Locality | +| ---------- | ----------- | ------------------- | -------- | +| `ace_wireCuttingStarted` | Wire cutting started | `[_unit, _fence]` | Global | diff --git a/docs/wiki/framework/xm157-framework.md b/docs/wiki/framework/xm157-framework.md index 45a2a19c21..d92d4b37e9 100644 --- a/docs/wiki/framework/xm157-framework.md +++ b/docs/wiki/framework/xm157-framework.md @@ -52,5 +52,4 @@ class CfgWeapons { }; }; }; - ``` diff --git a/extras/assets/CookoffSounds/ConvertWAVtoWSS.bat b/extras/assets/CookoffSounds/ConvertWAVtoWSS.bat new file mode 100644 index 0000000000..2db7169f14 --- /dev/null +++ b/extras/assets/CookoffSounds/ConvertWAVtoWSS.bat @@ -0,0 +1 @@ +forfiles /s /m *.wav /c "DeWSSDos -wss/0 -P -V -Y @path @FNAME.wss" diff --git a/extras/assets/CookoffSounds/shotbullet/close_1.wav b/extras/assets/CookoffSounds/shotbullet/close_1.wav new file mode 100644 index 0000000000..27e0c44dd3 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/close_1.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/close_2.wav b/extras/assets/CookoffSounds/shotbullet/close_2.wav new file mode 100644 index 0000000000..c51039cb73 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/close_2.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/close_3.wav b/extras/assets/CookoffSounds/shotbullet/close_3.wav new file mode 100644 index 0000000000..46955fa696 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/close_3.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/far_1.wav b/extras/assets/CookoffSounds/shotbullet/far_1.wav new file mode 100644 index 0000000000..bfccf1461b Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/far_1.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/far_2.wav b/extras/assets/CookoffSounds/shotbullet/far_2.wav new file mode 100644 index 0000000000..39b3e09dee Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/far_2.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/far_3.wav b/extras/assets/CookoffSounds/shotbullet/far_3.wav new file mode 100644 index 0000000000..5714da8440 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/far_3.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/mid_1.wav b/extras/assets/CookoffSounds/shotbullet/mid_1.wav new file mode 100644 index 0000000000..f757ca68f7 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/mid_1.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/mid_2.wav b/extras/assets/CookoffSounds/shotbullet/mid_2.wav new file mode 100644 index 0000000000..419e62e847 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/mid_2.wav differ diff --git a/extras/assets/CookoffSounds/shotbullet/mid_3.wav b/extras/assets/CookoffSounds/shotbullet/mid_3.wav new file mode 100644 index 0000000000..c2366ceb17 Binary files /dev/null and b/extras/assets/CookoffSounds/shotbullet/mid_3.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/close_1.wav b/extras/assets/CookoffSounds/shotrocket/close_1.wav new file mode 100644 index 0000000000..e76da3c464 Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/close_1.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/close_2.wav b/extras/assets/CookoffSounds/shotrocket/close_2.wav new file mode 100644 index 0000000000..82f5c2c657 Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/close_2.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/close_3.wav b/extras/assets/CookoffSounds/shotrocket/close_3.wav new file mode 100644 index 0000000000..29b447e502 Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/close_3.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/far_1.wav b/extras/assets/CookoffSounds/shotrocket/far_1.wav new file mode 100644 index 0000000000..ec019a7d5e Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/far_1.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/far_2.wav b/extras/assets/CookoffSounds/shotrocket/far_2.wav new file mode 100644 index 0000000000..640860b81f Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/far_2.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/far_3.wav b/extras/assets/CookoffSounds/shotrocket/far_3.wav new file mode 100644 index 0000000000..7481f3dfe9 Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/far_3.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/mid_1.wav b/extras/assets/CookoffSounds/shotrocket/mid_1.wav new file mode 100644 index 0000000000..b4e2c75259 Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/mid_1.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/mid_2.wav b/extras/assets/CookoffSounds/shotrocket/mid_2.wav new file mode 100644 index 0000000000..a21b529f07 Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/mid_2.wav differ diff --git a/extras/assets/CookoffSounds/shotrocket/mid_3.wav b/extras/assets/CookoffSounds/shotrocket/mid_3.wav new file mode 100644 index 0000000000..3fdffdbe0f Binary files /dev/null and b/extras/assets/CookoffSounds/shotrocket/mid_3.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/close_1.wav b/extras/assets/CookoffSounds/shotshell/close_1.wav new file mode 100644 index 0000000000..105d092a91 Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/close_1.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/close_2.wav b/extras/assets/CookoffSounds/shotshell/close_2.wav new file mode 100644 index 0000000000..899cde6505 Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/close_2.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/close_3.wav b/extras/assets/CookoffSounds/shotshell/close_3.wav new file mode 100644 index 0000000000..dbfeb32694 Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/close_3.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/far_1.wav b/extras/assets/CookoffSounds/shotshell/far_1.wav new file mode 100644 index 0000000000..5490655406 Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/far_1.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/far_2.wav b/extras/assets/CookoffSounds/shotshell/far_2.wav new file mode 100644 index 0000000000..f5cd390b60 Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/far_2.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/far_3.wav b/extras/assets/CookoffSounds/shotshell/far_3.wav new file mode 100644 index 0000000000..99fc796e7d Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/far_3.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/mid_1.wav b/extras/assets/CookoffSounds/shotshell/mid_1.wav new file mode 100644 index 0000000000..a911545a7f Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/mid_1.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/mid_2.wav b/extras/assets/CookoffSounds/shotshell/mid_2.wav new file mode 100644 index 0000000000..e8dc3e06de Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/mid_2.wav differ diff --git a/extras/assets/CookoffSounds/shotshell/mid_3.wav b/extras/assets/CookoffSounds/shotshell/mid_3.wav new file mode 100644 index 0000000000..ea6ddd94e6 Binary files /dev/null and b/extras/assets/CookoffSounds/shotshell/mid_3.wav differ diff --git a/extras/ruthberg_missions/360_Degree_Training_Course-Framework.zip b/extras/ruthberg_missions/360_Degree_Training_Course-Framework.zip new file mode 100644 index 0000000000..5886421544 Binary files /dev/null and b/extras/ruthberg_missions/360_Degree_Training_Course-Framework.zip differ diff --git a/extras/ruthberg_missions/360_Degree_Training_Course-Missions.zip b/extras/ruthberg_missions/360_Degree_Training_Course-Missions.zip new file mode 100644 index 0000000000..1d745d815b Binary files /dev/null and b/extras/ruthberg_missions/360_Degree_Training_Course-Missions.zip differ diff --git a/include/a3/data_f/penetration/hard_ground.rvmat b/include/a3/data_f/penetration/hard_ground.rvmat new file mode 100644 index 0000000000..1c4d7f82b0 --- /dev/null +++ b/include/a3/data_f/penetration/hard_ground.rvmat @@ -0,0 +1,9 @@ +surfaceInfo="A3\data_f\Penetration\hard_ground.bisurf"; +ambient[]={0.48699999,0.32800001,0.249,1}; +diffuse[]={0.48699999,0.32800001,0.249,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0,0,0,1}; +specularPower=1; +PixelShaderID="Normal"; +VertexShaderID="Basic"; diff --git a/include/a3/ui_f/hpp/defineResincl.inc b/include/a3/ui_f/hpp/defineResincl.inc index 2f513642bc..df589bde2d 100644 --- a/include/a3/ui_f/hpp/defineResincl.inc +++ b/include/a3/ui_f/hpp/defineResincl.inc @@ -1380,6 +1380,7 @@ enum #define IDC_OPTIONS_PP_DOF_SLIDER 1317 #define IDC_OPTIONS_PP_DOF_VALUE 1318 #define IDC_OPTIONS_PP_CAUSTICS 1319 +#define IDC_OPTIONS_PP_HAZE 1329 #define IDC_OPTIONS_PP_SHARPEN_SLIDER 1320 #define IDC_OPTIONS_PP_SHARPEN_VALUE 1321 #define IDC_OPTIONS_PP_COLOR_CORRECTIONS 1322 diff --git a/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf b/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf index be5a9adb3e..09aba83b06 100644 --- a/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf +++ b/include/a3/ui_f_curator/ui/displays/RscDisplayAttributes.sqf @@ -54,7 +54,7 @@ switch _mode do { _control = _display displayctrl _idc; //--- Admin specific attribute - _show = if (getnumber (_cfgControl >> "adminOnly") > 0) then {_enableAdmin} else {true}; + _show = [true, _enableAdmin] select (getnumber (_cfgControl >> "adminOnly") > 0); if ((_allAttributes || {_x == configname _cfgControl} count _attributes > 0) && _show) then { _controlPos = ctrlposition _control; @@ -75,10 +75,10 @@ switch _mode do { _target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull]; _name = switch (typename _target) do { - case (typename objnull): {gettext (configfile >> "cfgvehicles" >> typeof _target >> "displayname")}; - case (typename grpnull): {groupid _target}; - case (typename []): {format ["%1: %3 #%2",groupid (_target select 0),_target select 1,localize "str_a3_cfgmarkers_waypoint_0"]}; - case (typename ""): {markertext _target}; + case ("OBJECT"): {gettext (configfile >> "cfgvehicles" >> typeof _target >> "displayname")}; + case ("GROUP"): {groupid _target}; + case ("ARRAY"): {format ["%1: %3 #%2",groupid (_target select 0),_target select 1,localize "str_a3_cfgmarkers_waypoint_0"]}; + case ("STRING"): {markertext _target}; }; _ctrlTitle ctrlsettext format [ctrltext _ctrlTitle,toupper _name]; @@ -115,19 +115,19 @@ switch _mode do { _display = _this select 0; _target = missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target",objnull]; switch (typename _target) do { - case (typename objnull): { + case ("OBJECT"): { _isAlive = alive _target; waituntil {isnull _display || (_isAlive && !alive _target)}; }; - case (typename grpnull): { + case ("GROUP"): { waituntil {isnull _display || isnull _target}; }; - case (typename []): { + case ("ARRAY"): { _grp = _target select 0; _wpCount = count waypoints _grp; waituntil {isnull _display || (count waypoints _grp != _wpCount)}; }; - case (typename ""): { + case ("STRING"): { waituntil {isnull _display || markertype _target == ""}; }; }; diff --git a/include/a3/weapons_f/acc/data/optics.rvmat b/include/a3/weapons_f/acc/data/optics.rvmat new file mode 100644 index 0000000000..1183f3e16d --- /dev/null +++ b/include/a3/weapons_f/acc/data/optics.rvmat @@ -0,0 +1,82 @@ +class StageTI +{ + texture="a3\data_f\default_ti_ca.paa"; +}; +ambient[]={0,0,0,1}; +diffuse[]={0,0,0,1}; +forcedDiffuse[]={0,0,0,1}; +emmisive[]={0,0,0,1}; +specular[]={1,1,1,1}; +specularPower=500; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="a3\weapons_f\acc\data\optics_nohq.paa"; + uvSource="tex1"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0.0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 +{ + texture="a3\weapons_f\acc\data\optics_as.paa"; + uvSource="tex1"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(1,1,1,0.0,SMDI)"; + uvSource="tex1"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 +{ + texture="#(ai,64,64,1)fresnel(0.915,0.38)"; + uvSource="none"; +}; +class Stage7 +{ + texture="a3\data_f\env_land_optic_co.paa"; + uvSource="none"; +}; diff --git a/include/a3/weapons_f/acc/data/scope_view3_ca.paa b/include/a3/weapons_f/acc/data/scope_view3_ca.paa new file mode 100644 index 0000000000..d7ef93da49 Binary files /dev/null and b/include/a3/weapons_f/acc/data/scope_view3_ca.paa differ diff --git a/include/a3/weapons_f/acc/data/scope_view_ca.paa b/include/a3/weapons_f/acc/data/scope_view_ca.paa new file mode 100644 index 0000000000..a8dc6b370a Binary files /dev/null and b/include/a3/weapons_f/acc/data/scope_view_ca.paa differ diff --git a/include/a3/weapons_f/data/nightvisiontl.paa b/include/a3/weapons_f/data/nightvisiontl.paa new file mode 100644 index 0000000000..04bddf8795 Binary files /dev/null and b/include/a3/weapons_f/data/nightvisiontl.paa differ diff --git a/include/a3/weapons_f/reticle/data/optics_bg_dirt_ca.paa b/include/a3/weapons_f/reticle/data/optics_bg_dirt_ca.paa new file mode 100644 index 0000000000..d08da9e16d Binary files /dev/null and b/include/a3/weapons_f/reticle/data/optics_bg_dirt_ca.paa differ diff --git a/include/vn/weapons_f_vietnam/mines/m14/vn_mine_m14_mag.p3d b/include/vn/weapons_f_vietnam/mines/m14/vn_mine_m14_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/m15/vn_mine_m15_mag.p3d b/include/vn/weapons_f_vietnam/mines/m15/vn_mine_m15_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/m16/vn_mine_m16_mag.p3d b/include/vn/weapons_f_vietnam/mines/m16/vn_mine_m16_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/m16/vn_mine_tripwire_m16_02.p3d b/include/vn/weapons_f_vietnam/mines/m16/vn_mine_tripwire_m16_02.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/m16/vn_mine_tripwire_m16_04.p3d b/include/vn/weapons_f_vietnam/mines/m16/vn_mine_tripwire_m16_04.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/m18/vn_mine_m18.p3d b/include/vn/weapons_f_vietnam/mines/m18/vn_mine_m18.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/m18/vn_mine_m18_x3.p3d b/include/vn/weapons_f_vietnam/mines/m18/vn_mine_m18_x3.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/punji/vn_mine_punji_01_mag.p3d b/include/vn/weapons_f_vietnam/mines/punji/vn_mine_punji_01_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/punji/vn_mine_punji_02_mag.p3d b/include/vn/weapons_f_vietnam/mines/punji/vn_mine_punji_02_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/punji/vn_mine_punji_03_mag.p3d b/include/vn/weapons_f_vietnam/mines/punji/vn_mine_punji_03_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/tm57/vn_mine_tm57_mag.p3d b/include/vn/weapons_f_vietnam/mines/tm57/vn_mine_tm57_mag.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/tripwire_arty/vn_mine_tripwire_arty.p3d b/include/vn/weapons_f_vietnam/mines/tripwire_arty/vn_mine_tripwire_arty.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/tripwire_f1/vn_mine_tripwire_f1_02.p3d b/include/vn/weapons_f_vietnam/mines/tripwire_f1/vn_mine_tripwire_f1_02.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/include/vn/weapons_f_vietnam/mines/tripwire_f1/vn_mine_tripwire_f1_04.p3d b/include/vn/weapons_f_vietnam/mines/tripwire_f1/vn_mine_tripwire_f1_04.p3d deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tools/.vscode/settings.json b/tools/.vscode/settings.json index 57fcac4d62..490d2309b7 100644 --- a/tools/.vscode/settings.json +++ b/tools/.vscode/settings.json @@ -1,6 +1,7 @@ { "files.exclude": { "**/.hemttout": true, - "**/include": true + "**/include": true, + "**/extras": true } } \ No newline at end of file diff --git a/tools/.vscode/tasks.json b/tools/.vscode/tasks.json index 233c20e78c..eb919f5309 100644 --- a/tools/.vscode/tasks.json +++ b/tools/.vscode/tasks.json @@ -63,6 +63,16 @@ "--debug" ] }, + { + "label": "HEMTT check", + "command": "hemtt.exe", + "options": { + "cwd": "${workspaceFolder}" + }, + "args": [ + "check" + ], + }, { "label": "Test All", "dependsOn": [ @@ -71,7 +81,8 @@ "Validate Stringtables", "Validate headers", "Check Strings", - "SQFVM Checker" + "SQFVM Checker", + "HEMTT check" ], "group": { "kind": "test", @@ -89,8 +100,7 @@ "ci" ], "group": { - "kind": "build", - "isDefault": true + "kind": "build" } }, { @@ -103,7 +113,10 @@ "build", "-v" ], - "group": "build" + "group": { + "kind": "build", + "isDefault": true + } } ] } \ No newline at end of file diff --git a/include/vn/characters_f_vietnam/OPFOR/vests/items/vn_mine_satchel_02.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_AT15.p3d similarity index 100% rename from include/vn/characters_f_vietnam/OPFOR/vests/items/vn_mine_satchel_02.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_AT15.p3d diff --git a/include/vn/objects_f_vietnam/supply/a2_ammo/macv/vn_us_30cal.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V1.p3d similarity index 100% rename from include/vn/objects_f_vietnam/supply/a2_ammo/macv/vn_us_30cal.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V1.p3d diff --git a/include/vn/objects_f_vietnam/supply/a2_ammo/macv/vn_us_can_30.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V2.p3d similarity index 100% rename from include/vn/objects_f_vietnam/supply/a2_ammo/macv/vn_us_can_30.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V2.p3d diff --git a/include/vn/objects_f_vietnam/supply/a2_ammo/pavn/vn_pavn_50_can.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V3.p3d similarity index 100% rename from include/vn/objects_f_vietnam/supply/a2_ammo/pavn/vn_pavn_50_can.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V3.p3d diff --git a/include/vn/objects_f_vietnam/usarmy/furniture/vn_us_fort_common_crate_01.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V4.p3d similarity index 100% rename from include/vn/objects_f_vietnam/usarmy/furniture/vn_us_fort_common_crate_01.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_IED_V4.p3d diff --git a/include/vn/objects_f_vietnam/usarmy/supply/mortar_m2/vn_prop_60mm_crate_01.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_Satchel.p3d similarity index 100% rename from include/vn/objects_f_vietnam/usarmy/supply/mortar_m2/vn_prop_60mm_crate_01.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_Satchel.p3d diff --git a/include/vn/objects_f_vietnam/usarmy/supply/mortar_m29/vn_prop_81mm_crate_02.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_TM46.p3d similarity index 100% rename from include/vn/objects_f_vietnam/usarmy/supply/mortar_m29/vn_prop_81mm_crate_02.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_Put/CUP_TM46.p3d diff --git a/include/vn/static_f_vietnam/mortar_m2/vn_shell_60mm_m302_wp_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/AGS/data/ui/ags_static_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_m2/vn_shell_60mm_m302_wp_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/AGS/data/ui/ags_static_ca.paa diff --git a/include/vn/static_f_vietnam/mortar_m2/vn_shell_60mm_m49a2_he_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/DShKM/data/ui/icomap_DShKM_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_m2/vn_shell_60mm_m49a2_he_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/DShKM/data/ui/icomap_DShKM_ca.paa diff --git a/include/vn/static_f_vietnam/mortar_m2/vn_shell_60mm_m83_lume_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/KORD/data/ui/icomap_kord_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_m2/vn_shell_60mm_m83_lume_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/KORD/data/ui/icomap_kord_ca.paa diff --git a/include/vn/static_f_vietnam/mortar_m29/vn_shell_81mm_m374_he_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/M2/data/ui/icomap_M2_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_m29/vn_shell_81mm_m374_he_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/M2/data/ui/icomap_M2_ca.paa diff --git a/include/vn/static_f_vietnam/mortar_type53/vn_shell_82mm_d832_wp_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/M252/data/ui/icomap_mortar_m251_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_type53/vn_shell_82mm_d832_wp_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/M252/data/ui/icomap_mortar_m251_ca.paa diff --git a/include/vn/static_f_vietnam/mortar_type53/vn_shell_82mm_o832d_he_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/Mk19/data/ui/icomap_mk19_stat_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_type53/vn_shell_82mm_o832d_he_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/Mk19/data/ui/icomap_mk19_stat_ca.paa diff --git a/include/vn/static_f_vietnam/mortar_type53/vn_shell_82mm_s832s_lume_ammo.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/Podnos/data/ui/podnos_2b14_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/mortar_type53/vn_shell_82mm_s832s_lume_ammo.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/Podnos/data/ui/podnos_2b14_ca.paa diff --git a/include/vn/static_f_vietnam/tow/vn_static_tow_mag.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/SPG9/data/ui/icon_spg9_ca.paa similarity index 100% rename from include/vn/static_f_vietnam/tow/vn_static_tow_mag.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/SPG9/data/ui/icon_spg9_ca.paa diff --git a/include/vn/weapons_f_vietnam/mines/m112/vn_mine_m112_mag.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/TOW/data/ui/icomap_tow_static_ca.paa similarity index 100% rename from include/vn/weapons_f_vietnam/mines/m112/vn_mine_m112_mag.p3d rename to tools/pDummies/CUP/Weapons/CUP_Weapons_StaticWeapons/TOW/data/ui/icomap_tow_static_ca.paa