Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breathing - Add Helmet Compatibility for Vehicle/Personal Oxygen Lines #716

Open
wants to merge 3 commits into
base: dev-Tomcat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions addons/breathing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
missionNamespace setVariable [QGVAR(availOxyMaskList), _array, true];

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), _arrayHelmet, true];
15 changes: 15 additions & 0 deletions addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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, "CfgWeapons"] call EFUNC(chemical,getList);
missionNamespace setVariable [QGVAR(availOxyHelmetList), _array, true];
},
true
] call CBA_Settings_fnc_init;

//Enable Check Breathing medical action
[
QGVAR(enableCheckBreathing),
Expand Down
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_attachPersonalOxygen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_attachVehicleOxygen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_checkOxygenMask.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
6 changes: 6 additions & 0 deletions addons/breathing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,12 @@
<French>Spécifiez les masques que vous souhaitez utiliser comme masque à oxygène.</French>
<Chinesesimp>设置哪些护目镜可以作为氧气面罩</Chinesesimp>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_AVAIL_OXYHELMET">
<English>Available Oxygen Helmets</English>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_AVAIL_OXYHELMET_DISC">
<English>Sets which helmets can act as oxygen masks</English>
</Key>
<Key ID="STR_KAT_Breathing_AttachPersonalOxygenTank">
<English>Connect Personal Oxygen</English>
<Japanese>個人用酸素供給機に接続</Japanese>
Expand Down
6 changes: 3 additions & 3 deletions addons/chemical/CfgSounds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CfgSounds {
sound[] =
{
QPATHTOF(audio\breath1.ogg),
4,
2,
1.0,
10
};
Expand All @@ -61,7 +61,7 @@ class CfgSounds {
sound[] =
{
QPATHTOF(audio\breath2.ogg),
4,
2,
1.0,
10
};
Expand All @@ -73,7 +73,7 @@ class CfgSounds {
sound[] =
{
QPATHTOF(audio\heavyBreath.ogg),
4,
2,
1.0,
10
};
Expand Down
Loading