From dce5f0f9f3597a46d56697b6e25eb4789557234e Mon Sep 17 00:00:00 2001 From: mazinskihenry <33608576+mazinskihenry@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:51:23 -0800 Subject: [PATCH 1/3] Oxygen Helmet Compatibility --- addons/breathing/XEH_preInit.sqf | 15 +++++++++++++++ .../functions/fnc_attachPersonalOxygen.sqf | 2 +- .../functions/fnc_attachVehicleOxygen.sqf | 2 +- .../breathing/functions/fnc_checkOxygenMask.sqf | 2 +- addons/breathing/stringtable.xml | 6 ++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/addons/breathing/XEH_preInit.sqf b/addons/breathing/XEH_preInit.sqf index 4bdfb6a49..cc37e76cf 100644 --- a/addons/breathing/XEH_preInit.sqf +++ b/addons/breathing/XEH_preInit.sqf @@ -33,6 +33,21 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +//Adds available oxygen helmets +[ + QGVAR(availOxyHelmet), + "EDITBOX", + [LLSTRING(SETTING_AVAIL_OXYHELMET), LLSTRING(SETTING_AVAIL_OXYHELMET_DISC)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + "'H_PilotHelmetFighter_B', 'H_PilotHelmetFighter_O', 'H_PilotHelmetFighter_I', 'H_PilotHelmetFighter_I_E'", + 1, + { + private _array = [_this, "CfgGlasses"] call EFUNC(chemical,getList); + missionNamespace setVariable [QGVAR(availOxyHelmetList), _array, true]; + }, + true +] call CBA_Settings_fnc_init; + //Enable Check Breathing medical action [ QGVAR(enableCheckBreathing), diff --git a/addons/breathing/functions/fnc_attachPersonalOxygen.sqf b/addons/breathing/functions/fnc_attachPersonalOxygen.sqf index 8a38d90b1..dbf3d2c9a 100644 --- a/addons/breathing/functions/fnc_attachPersonalOxygen.sqf +++ b/addons/breathing/functions/fnc_attachPersonalOxygen.sqf @@ -48,7 +48,7 @@ _patient setVariable [QGVAR(oxygenMaskStatus), [(_largestTankValue + 1), 1], tru _this params ["_args", "_pfhID"]; _args params ["_patient"]; - if !((_patient call EFUNC(airway,checkMask))) exitWith { + if !((_patient call FUNC(checkOxygenMask))) exitWith { _patient call FUNC(detachPersonalOxygen); _pfhID call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/breathing/functions/fnc_attachVehicleOxygen.sqf b/addons/breathing/functions/fnc_attachVehicleOxygen.sqf index 808821932..a9ca978bd 100644 --- a/addons/breathing/functions/fnc_attachVehicleOxygen.sqf +++ b/addons/breathing/functions/fnc_attachVehicleOxygen.sqf @@ -40,7 +40,7 @@ _patient setVariable [QGVAR(oxygenMaskActive), true, true]; _pfhID call CBA_fnc_removePerFrameHandler; }; - if !((_patient call EFUNC(airway,checkMask))) exitWith { + if !((_patient call FUNC(checkOxygenMask))) exitWith { _patient setVariable [QGVAR(oxygenMaskActive), false, true]; _pfhID call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/breathing/functions/fnc_checkOxygenMask.sqf b/addons/breathing/functions/fnc_checkOxygenMask.sqf index 5be7d89e3..be243e1e4 100644 --- a/addons/breathing/functions/fnc_checkOxygenMask.sqf +++ b/addons/breathing/functions/fnc_checkOxygenMask.sqf @@ -17,7 +17,7 @@ params ["_patient"]; -if ((goggles _patient in (missionNamespace getVariable [QGVAR(availOxyMaskList), []]))) exitWith { +if ((goggles _patient in (missionNamespace getVariable [QGVAR(availOxyMaskList), []])) || (headgear _patient in (missionNamespace getVariable [QGVAR(availOxyHelmetList), []]))) exitWith { true }; diff --git a/addons/breathing/stringtable.xml b/addons/breathing/stringtable.xml index 451df8d86..e10d1f815 100644 --- a/addons/breathing/stringtable.xml +++ b/addons/breathing/stringtable.xml @@ -2910,6 +2910,12 @@ Spécifiez les masques que vous souhaitez utiliser comme masque à oxygène. 设置哪些护目镜可以作为氧气面罩 + + Available Oxygen Helmets + + + Sets which helmets can act as oxygen masks + Connect Personal Oxygen 個人用酸素供給機に接続 From d5d409cbb5b3f9848acd7012942f4089d6397a0f Mon Sep 17 00:00:00 2001 From: mazinskihenry <33608576+mazinskihenry@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:16:09 -0800 Subject: [PATCH 2/3] Adjust --- addons/breathing/XEH_postInit.sqf | 9 +++++++-- addons/breathing/XEH_preInit.sqf | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/breathing/XEH_postInit.sqf b/addons/breathing/XEH_postInit.sqf index 62efb8271..0a90ae82a 100644 --- a/addons/breathing/XEH_postInit.sqf +++ b/addons/breathing/XEH_postInit.sqf @@ -30,7 +30,12 @@ [QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler; [QACEGVAR(medical,woundReceived),LINKFUNC(handlePulmoHit)] call CBA_fnc_addEventHandler; -private _items = missionNamespace getVariable [QGVAR(availOxyMask), "'G_AirPurifyingRespirator_01_F'"]; +private _items = missionNamespace getVariable [QGVAR(availOxyMask), "'kat_mask_solr'"]; private _array = [_items, "CfgGlasses"] call EFUNC(chemical,getList); -missionNamespace setVariable [QGVAR(availOxyMaskList), _array, true]; \ No newline at end of file +missionNamespace setVariable [QGVAR(availOxyMaskList), _array, true]; + +private _items = missionNamespace getVariable [QGVAR(availOxyHelmet), "'H_PilotHelmetFighter_B', 'H_PilotHelmetFighter_O', 'H_PilotHelmetFighter_I', 'H_PilotHelmetFighter_I_E'"]; +private _array = [_items, "CfgWeapons"] call EFUNC(chemical,getList); + +missionNamespace setVariable [QGVAR(availOxyHelmetList), _array, true]; \ No newline at end of file diff --git a/addons/breathing/XEH_preInit.sqf b/addons/breathing/XEH_preInit.sqf index cc37e76cf..99a634859 100644 --- a/addons/breathing/XEH_preInit.sqf +++ b/addons/breathing/XEH_preInit.sqf @@ -42,7 +42,7 @@ PREP_RECOMPILE_END; "'H_PilotHelmetFighter_B', 'H_PilotHelmetFighter_O', 'H_PilotHelmetFighter_I', 'H_PilotHelmetFighter_I_E'", 1, { - private _array = [_this, "CfgGlasses"] call EFUNC(chemical,getList); + private _array = [_this, "CfgWeapons"] call EFUNC(chemical,getList); missionNamespace setVariable [QGVAR(availOxyHelmetList), _array, true]; }, true From fa5f86c1806717cccd0de8b76b782186eeda4fe9 Mon Sep 17 00:00:00 2001 From: mazinskihenry <33608576+mazinskihenry@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:19:48 -0800 Subject: [PATCH 3/3] Finished --- addons/breathing/XEH_postInit.sqf | 6 +++--- addons/chemical/CfgSounds.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/breathing/XEH_postInit.sqf b/addons/breathing/XEH_postInit.sqf index 0a90ae82a..b360433ab 100644 --- a/addons/breathing/XEH_postInit.sqf +++ b/addons/breathing/XEH_postInit.sqf @@ -35,7 +35,7 @@ private _array = [_items, "CfgGlasses"] call EFUNC(chemical,getList); missionNamespace setVariable [QGVAR(availOxyMaskList), _array, true]; -private _items = missionNamespace getVariable [QGVAR(availOxyHelmet), "'H_PilotHelmetFighter_B', 'H_PilotHelmetFighter_O', 'H_PilotHelmetFighter_I', 'H_PilotHelmetFighter_I_E'"]; -private _array = [_items, "CfgWeapons"] call EFUNC(chemical,getList); +private _itemsHelmet = missionNamespace getVariable [QGVAR(availOxyHelmet), "'H_PilotHelmetFighter_B', 'H_PilotHelmetFighter_O', 'H_PilotHelmetFighter_I', 'H_PilotHelmetFighter_I_E'"]; +private _arrayHelmet = [_itemsHelmet, "CfgWeapons"] call EFUNC(chemical,getList); -missionNamespace setVariable [QGVAR(availOxyHelmetList), _array, true]; \ No newline at end of file +missionNamespace setVariable [QGVAR(availOxyHelmetList), _arrayHelmet, true]; \ No newline at end of file diff --git a/addons/chemical/CfgSounds.hpp b/addons/chemical/CfgSounds.hpp index 8ce062af6..b450407cc 100644 --- a/addons/chemical/CfgSounds.hpp +++ b/addons/chemical/CfgSounds.hpp @@ -49,7 +49,7 @@ class CfgSounds { sound[] = { QPATHTOF(audio\breath1.ogg), - 4, + 2, 1.0, 10 }; @@ -61,7 +61,7 @@ class CfgSounds { sound[] = { QPATHTOF(audio\breath2.ogg), - 4, + 2, 1.0, 10 }; @@ -73,7 +73,7 @@ class CfgSounds { sound[] = { QPATHTOF(audio\heavyBreath.ogg), - 4, + 2, 1.0, 10 };