Skip to content

Commit

Permalink
Merge branch 'KAT-Advanced-Medical:dev-Tomcat' into dev-Tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
Cplhardcore authored Nov 18, 2024
2 parents 54a6e38 + 9f8647e commit e22c562
Show file tree
Hide file tree
Showing 29 changed files with 245 additions and 27 deletions.
2 changes: 1 addition & 1 deletion addons/breathing/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ACE_Medical_Treatment_Actions {
allowSelfTreatment = 0;
medicRequired = 0;
treatmentTime = 2;
condition = "true";
condition = QUOTE(GVAR(enableCheckBreathing));
callbackSuccess = QFUNC(checkBreathing);
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
Expand Down
10 changes: 10 additions & 0 deletions addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ PREP_RECOMPILE_END;
true
] call CBA_Settings_fnc_init;

//Enable Check Breathing medical action
[
QGVAR(enableCheckBreathing),
"CHECKBOX",
[LLSTRING(SETTING_enableCheckBreathing),LLSTRING(SETTING_enableCheckBreathing_DESC)],
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)],
[true],
true
] call CBA_Settings_fnc_init;

// Lethal SpO2 value
[
QGVAR(SpO2_dieValue),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (GVAR(showCyanosis) && _selectionN in [0,2,3]) then {
private _spO2 = 0;

if (alive _target) then {
_spO2 = GET_SPO2(_target);
_spO2 = GET_KAT_SPO2(_target);
};

if (_spO2 <= GVAR(slightValue) || HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _patient setVariable [QGVAR(PulseOximeter_Attached), _attachedPulseOximeter, tru
};

private _HR = GET_HEART_RATE(_patient);
private _SpO2 = GET_SPO2(_patient);
private _SpO2 = GET_KAT_SPO2(_patient);

if (([_patient,_bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))) then {
_HR = 0;
Expand All @@ -58,7 +58,7 @@ _patient setVariable [QGVAR(PulseOximeter_Attached), _attachedPulseOximeter, tru
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

private _SpO2 = GET_SPO2(_patient);
private _SpO2 = GET_KAT_SPO2(_patient);

if (([_patient,_bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))) then {
_SpO2 = 0;
Expand Down
6 changes: 6 additions & 0 deletions addons/breathing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2650,5 +2650,11 @@
<Spanish>%1 retiró la cánula nasal</Spanish>
<Dutch>%1 verwijderde nasale canule</Dutch>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_enableCheckBreathing">
<English>Enable Check Breathing</English>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_enableCheckBreathing_DESC">
<English>Whether or not Check Breathing medical action is enabled</English>
</Key>
</Package>
</Project>
1 change: 0 additions & 1 deletion addons/chemical/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ class CfgVehicles {
};
};


class Box_NATO_AmmoOrd_F;
class ACE_Box_82mm_Mo_HE: Box_NATO_AmmoOrd_F {
class TransportMagazines;
Expand Down
9 changes: 9 additions & 0 deletions addons/chemical/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ class CfgWeapons {
};
};

class ItemWatch;
class KAT_ChemicalDetector: ItemWatch {
ACE_hideItemType = "Watch";
author = "Mazinski";
descriptionShort = CSTRING(ChemicalDetectorDescription);
displayName = CSTRING(ChemicalDetectorDisplayName);
picture = QPATHTOF(UI\kat_chemicalDet_icon.paa);
};

class CannonCore;
class mortar_82mm: CannonCore {
magazines[] += {
Expand Down
83 changes: 83 additions & 0 deletions addons/chemical/RscTitles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#define KAT_CHEM_GRID_WAbs (((safezoneW / safezoneH) min 0.7))
#define KAT_CHEM_GRID_HAbs ((((safezoneW / safezoneH) min 1.2) / 1.6))
#define KAT_CHEM_GRID_W ((((safeZoneW / safeZoneH) min 0.7) / 40))
#define KAT_CHEM_GRID_H (((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25))
#define KAT_CHEM_GRID_X ((safeZoneX + (safeZoneW - ((safeZoneW / safeZoneH) min 1.2)) / 11))
#define KAT_CHEM_GRID_Y ((safeZoneY + (safeZoneH - (((safeZoneW / safeZoneH) min 1.2) / 1.2)) / 0.8))

#define KAT_CHEM_POS_H(N) ((N) * KAT_CHEM_GRID_H)

#define ST_LEFT 0
#define ST_CENTER 2
#define ST_RIGHT 1

#define pixelW (1 / (getResolution select 2))
#define pixelH (1 / (getResolution select 3))
#define pixelScale 0.50

// pixel grids macros
#define UI_GRID_W (pixelW * pixelGridBase)
#define UI_GRID_H (pixelH * pixelGridBase)

#define SAFEZONE_X_RIGHTEDGE ((safeZoneX - 1) * -1)
#define SAFEZONE_Y_LOWEDGE ((safeZoneY - 1) * -1)

#define FRAME_W(N) ((UI_GRID_W * (N)) * (1.7777 / (getResolution select 4)))
#define FRAME_H(N) ((UI_GRID_H * (N)))

class RscTitles
{
class KAT_ChemicalDetector
{
idd = 18835;
enableSimulation = 1;
movingEnable = 0;
fadeIn=0;
fadeOut=1;
duration = 10e10;
onLoad = "uiNamespace setVariable ['KAT_ChemicalDetector', _this select 0];";
class controls
{
class KatChemIcon: RscPicture
{
idc = 18801;
text = "\x\kat\addons\chemical\UI\kat_chemicalDet.paa";
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(15));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(25));
w = QUOTE(FRAME_W(25));
h = QUOTE(FRAME_H(25));
};
class KatChemTime: RscText
{
idc = 18804;
style = ST_CENTER;
shadow = 0;
font = "PuristaBold";
text = "12:00"; //--- ToDo: Localize;
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(7.2));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(6));
w = QUOTE(FRAME_W(7.5));
h = QUOTE(FRAME_H(4));
colorBackground[] = {0,0,0,0};
colorText[] = {0.3,0.3,0.3,0.8};
sizeEx = QUOTE(FRAME_H(2));
};
class KatChemStrength: RscText
{
idc = 18805;
style = ST_RIGHT;
valign = "middle";
shadow = 0;
font = "PuristaBold";
text = "0"; //--- ToDo: Localize;
x = QUOTE(SAFEZONE_X_RIGHTEDGE - FRAME_W(25) - FRAME_W(2.1));
y = QUOTE(SAFEZONE_Y_LOWEDGE - FRAME_H(7.5));
w = QUOTE(FRAME_W(5));
h = QUOTE(FRAME_H(3));
colorBackground[] = {0,0,0,0};
colorText[] = {0.3,0.3,0.3,0.8};
sizeEx = QUOTE(FRAME_H(2.2));
};
};
};
};
2 changes: 2 additions & 0 deletions addons/chemical/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ PREP(handleGasMaskDur);
PREP(handleRespawn);
PREP(hasGasmask);
PREP(hasGasMaskON);
PREP(hideChemDetector);
PREP(init);
PREP(initModule);
PREP(showChemDetector);
PREP(spawnSmoke);
PREP(throwGrenade);
PREP(treatmentAdvanced_AtropineLocal);
Expand Down
13 changes: 13 additions & 0 deletions addons/chemical/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,16 @@ if (hasInterface) then {
private _items = missionNamespace getVariable [QGVAR(availGasmask), "'G_AirPurifyingRespirator_01_F'"];
private _array = [_items, "CfgGlasses"] call FUNC(getList);
missionNamespace setVariable [QGVAR(availGasmaskList), _array, true];

["KAT_ChemicalDetector", QGVAR(showChemDetector), "Show Chemical Detector", {
// Conditions: canInteract
if (!([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call ACEFUNC(common,canInteractWith)) || {!('KAT_ChemicalDetector' in assignedItems ACE_player)}) exitWith { false };

if !(GETMVAR(GVAR(ChemDetectorActive),false)) then {
[ACE_player] call FUNC(showChemDetector);
} else {
call FUNC(hideChemDetector);
};

true
}, { false }, [24, [false, false, false]], false] call CBA_fnc_addKeybind;
4 changes: 3 additions & 1 deletion addons/chemical/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class CfgPatches {
"kat_gasmaskFilter",
"KAT_M7A3",
"KAT_CAS_M43_Bomb",
"KAT_CAS_R_80mm_GAS_POD"
"KAT_CAS_R_80mm_GAS_POD",
"KAT_ChemicalDetector"
};
ammo[] = {
"KAT_Gas_TripWireMine_Ammo",
Expand Down Expand Up @@ -60,5 +61,6 @@ class CfgPatches {
#include "CfgVehicles.hpp"
#include "CfgSounds.hpp"
#include "ui\RscAttributes.hpp"
#include "RscTitles.hpp"
#include "ACE_Medical_Treatment_Actions.hpp"
#include "CfgGlasses.hpp"
1 change: 1 addition & 0 deletions addons/chemical/functions/fnc_gasCheck.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ _radius_min = if (_radius_min isEqualTo 0) then {_radius_max / 2} else {_radius_
_logic setVariable [QGVAR(gas_active), true, true];
_logic setVariable [QGVAR(gas_playerArr), [], true];
_logic setVariable [QGVAR(gas_position), _position, true];
_logic setVariable [QGVAR(gas_radius), _radius_max, true];

// Function to check players within the gas zone
private _checkPlayers = {
Expand Down
19 changes: 19 additions & 0 deletions addons/chemical/functions/fnc_hideChemDetector.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet
* Modified: Mazinski
* Removes the KWatch from the screen.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call kat_watch_fnc_hideKWatch
*
* Public: No
*/
GVAR(ChemDetectorActive) = false;
"KAT_ChemicalDetector" cutText ["","PLAIN",0,true];
70 changes: 70 additions & 0 deletions addons/chemical/functions/fnc_showChemDetector.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet
* Modified: Mazinski
* Displays the KWatch on screen.
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_watch_fnc_showKWatch
*
* Public: Yes
*/

params ["_unit"];

"KAT_ChemicalDetector" cutRsc ["KAT_ChemicalDetector", "PLAIN", 0, true];

if (isNull (uiNamespace getVariable ["KAT_ChemicalDetector", displayNull])) exitWith {};

GVAR(ChemDetectorActive) = true;

private _display = uiNamespace getVariable ["KAT_ChemicalDetector", displayNull];
private _background = _display displayCtrl 18801;
private _time = _display displayCtrl 18804;
private _exposure = _display displayCtrl 18805;

[{
_this params ["_args", "_pfhID"];
_args params ["_unit", "_time", "_exposure"];

if !(GVAR(ChemDetectorActive)) exitWith {
_pfhID call CBA_fnc_removePerFrameHandler;
};

if !(alive _unit) exitWith {
call FUNC(hideChemDetector);
_pfhID call CBA_fnc_removePerFrameHandler;
};

if !("KAT_ChemicalDetector" in assignedItems _unit) exitWith {
call FUNC(hideChemDetector);
_pfhID call CBA_fnc_removePerFrameHandler;
};

private _hour = floor dayTime;
private _minute = floor ((dayTime - _hour) * 60);

_time ctrlSetText (format ["%1:%2", [_hour, 2] call CBA_fnc_formatNumber, [_minute, 2] call CBA_fnc_formatNumber]);

private _gas = nearestObjects [_unit, ["kat_module_zeus_gas"], 2000];

if ((count _gas) > 0) then {
private _distance = _unit distance (_gas select 0);
private _radius = (_gas select 0) getVariable [QGVAR(gas_radius), 0];

_exposure ctrlSetText ((linearConversion[0, _radius, _distance, 1, 0, true]) toFixed 2);
} else {
_exposure ctrlSetText str (0);
};

}, 1, [
_unit,
_time,
_exposure
]] call CBA_fnc_addPerFrameHandler;
6 changes: 6 additions & 0 deletions addons/chemical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@
<Russian>Герметик, который используется для герметизации предметов, например, при утечке токсичного вещества</Russian>
<Dutch>Afdichtmiddel dat gebruikt wordt om een object te dichten wanneer er bijvoorbeeld een giftige stof lekt</Dutch>
</Key>
<Key ID="STR_KAT_Chemical_ChemicalDetectorDisplayName">
<English>JCAD Chemical Detector</English>
</Key>
<Key ID="STR_KAT_Chemical_ChemicalDetectorDescription">
<English>Used to detect KAT toxic chemicals</English>
</Key>
<Key ID="STR_KAT_Chemical_giveGasMask_action">
<English>Put on gas mask</English>
<Spanish>Poner mascara de gas</Spanish>
Expand Down
2 changes: 0 additions & 2 deletions addons/chemical/ui/RscAttributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class RscPicture;
class ctrlToolbox;
class RscButton;



class RscDisplayAttributes {
class Controls {
class Background;
Expand Down
Binary file added addons/chemical/ui/kat_chemicalDet.paa
Binary file not shown.
Binary file added addons/chemical/ui/kat_chemicalDet_icon.paa
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ GVAR(PulseRateReady) = true;
if (HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget),_partIndex)) then {
_bp = [0,0];
} else {
_spO2 = GET_SPO2(GVAR(AEDX_MonitorTarget));
_spO2 = GET_KAT_SPO2(GVAR(AEDX_MonitorTarget));
_pr = GVAR(AEDX_MonitorTarget) getVariable [QACEGVAR(medical,heartRate), 0];
};

Expand Down
4 changes: 2 additions & 2 deletions addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if (_patient getVariable ["kat_AEDXPatient_PFH", -1] isEqualTo -1) then {
_bp = [0,0];
_pr = 0;
} else {
_spO2 = GET_SPO2(_patient);
_spO2 = GET_KAT_SPO2(_patient);

_etco2 = GET_ETCO2(_patient);
_breathrate = GET_BREATHING_RATE(_patient);
Expand Down Expand Up @@ -291,7 +291,7 @@ if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && {(_pat
if (_patient getVariable [QGVAR(DefibrillatorInUse), false] || !(_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false])) then {
} else {
private _hr = _patient getVariable [QACEGVAR(medical,heartRate), 80];
private _spO2 = GET_SPO2(_patient);
private _spO2 = GET_KAT_SPO2(_patient);
if (_spO2 < GVAR(AED_X_Monitor_SpO2Warning) || _tourniquetApplied) then {
playSound3D [QPATHTOF_SOUND(sounds\spo2warning.wav), _soundSource, false, getPosASL _soundSource, 5, 1, 15];
};
Expand Down
2 changes: 1 addition & 1 deletion addons/feedback/functions/fnc_handleEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BEGIN_COUNTER(handleEffects);

// - Current state info -------------------------------------------------------
private _opioid = GET_PP(ACE_player);
private _spO2 = GET_SPO2(ACE_player);
private _spO2 = GET_KAT_SPO2(ACE_player);
private _unconscious = IS_UNCONSCIOUS(ACE_player);

// - Visual effects -----------------------------------------------------------
Expand Down
Loading

0 comments on commit e22c562

Please sign in to comment.