Skip to content
Draft
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
12 changes: 11 additions & 1 deletion addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,33 @@ class GVAR(actions) {
displayName = CSTRING(Actions_CheckPulse);
displayNameProgress = CSTRING(Check_Pulse_Content);
allowedSelections[] = {"All"};
condition = QUOTE(GVAR(advancedDiagnose) != 0);
treatmentTime = QUOTE([ARR_2(2.5,15)] select GVAR(enableRealisticPulseChecking));
condition = QUOTE(GVAR(advancedDiagnose) != 0 && {!GVAR(enableRealisticPulseChecking) || {(_medic getSlotItemName TYPE_WATCH) isKindOf [ARR_2('ItemWatch',configFile >> 'CfgWeapons')]}});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to require a watch for basic pulse checking or just have the watch requirement for realistic pulse checking?

callbackSuccess = QFUNC(checkPulse);
callbackProgress = QFUNC(checkPulseProgress);
callbackFailure = QUOTE(QQGVAR(checkPulse) cutText [ARR_2('','PLAIN')]);
animationMedicProne = "";
animationMedicSelfProne = "";
};
class CheckBloodPressure: CheckPulse {
displayName = CSTRING(Actions_CheckBloodPressure);
displayNameProgress = CSTRING(Check_Bloodpressure_Content);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
treatmentTime = 15;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

15 is too long imo. I think 6 would be more reasonable, given the estimates you can do after 6 seconds (I would also change the pulse checking time to 6 too when realistic pulse checking is disabled).

medicRequired = 1;
callbackSuccess = QFUNC(checkBloodPressure);
callbackProgress = "";
callbackFailure = "";
};
class CheckResponse: CheckPulse {
displayName = CSTRING(Check_Response);
displayNameProgress = CSTRING(Check_Response_Content);
allowedSelections[] = {"Head"};
treatmentTime = 2.5;
allowSelfTreatment = 0;
callbackSuccess = QFUNC(checkResponse);
callbackProgress = "";
callbackFailure = "";
};

// - Misc -----------------------------------------------------------------
Expand Down
32 changes: 32 additions & 0 deletions addons/medical_treatment/RscTitles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class RscWatch;
class RscPicture;

class RscTitles {
class GVAR(checkPulse) {
idd = -1;
enableSimulation = 1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(checkPulseDisplay),_this select 0)]);
duration = 60;
class ControlsBackground {
class TheVignette: RscPicture {
idc = 5000;
x = "safezoneX";
y = "safezoneY";
w = "safezoneW";
h = "safezoneH";
text = QPATHTOF(ui\checkPulse_ca.paa);
};
};
class Controls {};
class Objects {
class TheWatch: RscWatch {
idc = 5001;
model = "\a3\Missions_F_Oldman\Systems\UI\Objects\WatchDummy.p3d";
position[] = {0, 0, 0.15};
inBack = 0;
scale = 2;
enableZoom = 0;
};
};
};
};
1 change: 1 addition & 0 deletions addons/medical_treatment/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PREP(checkBloodPressure);
PREP(checkBloodPressureLocal);
PREP(checkPulse);
PREP(checkPulseLocal);
PREP(checkPulseProgress);
PREP(checkResponse);
PREP(cprSuccess);
PREP(cprFailure);
Expand Down
3 changes: 2 additions & 1 deletion addons/medical_treatment/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class CfgPatches {
#include "ACE_Medical_Facilities.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgReplacementItems.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "Cfg3DEN.hpp"
#include "CfgMagazines.hpp"
#include "RscTitles.hpp"

#endif
2 changes: 2 additions & 0 deletions addons/medical_treatment/functions/fnc_checkPulse.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

params ["_medic", "_patient", "_bodyPart"];

QGVAR(checkPulse) cutText ["", "PLAIN"];

[QGVAR(checkPulseLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent;
53 changes: 53 additions & 0 deletions addons/medical_treatment/functions/fnc_checkPulseProgress.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Handles the progress of pulse checking.
*
* Arguments:
* 0: Arguments <ARRAY>
* - 0: Medic (not used) <OBJECT>
* - 1: Patient <OBJECT>
*
* Return Value:
* Continue pulse checking <BOOL>
*
* Example:
* [[player, cursorObject]] call ace_medical_treatment_fnc_checkPulseProgress
*
* Public: No
*/

if (!GVAR(enableRealisticPulseChecking)) exitWith {true};

(_this select 0) params ["", "_patient"];

private _display = uiNamespace getVariable [QGVAR(checkPulseDisplay), displayNull];

if (isNull _display) then {
TRACE_1("creating display",_this);
QGVAR(checkPulse) cutRsc [QGVAR(checkPulse), "PLAIN"];
_display setVariable [QGVAR(lastPulse), CBA_missionTime - 0.5];
} else {
private _pulse = GET_HEART_RATE(_patient);
_lastPulse = _display getVariable [QGVAR(lastPulse), -1];

private _nextPulse = _lastPulse + (if (_pulse == 0) then {1e99} else { 60 / _pulse });
if (CBA_missionTime > _nextPulse) then { _display setVariable [QGVAR(lastPulse), _nextPulse]; };
private _fade = (linearConversion [-0.1, 0, CBA_missionTime - _nextPulse, 0, 0.85, true] max linearConversion [0.35, 0, CBA_missionTime - _lastPulse, 0, 0.75, true]) ^ 2;

if (EGVAR(common,epilepsyFriendlyMode)) then {
_fade = _fade min 0.2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure if this is enough to not trigger seizures.

Regardless, it would be better to implement an icon.

};

private _ctrlVignette = _display displayCtrl 5000;
_ctrlVignette ctrlSetTextColor [0, 0, 0, _fade];

private _ctrlWatch = _display displayCtrl 5001;
_ctrlWatch ctrlSetPosition [safeZoneX + (safeZoneW * 0.5), (ctrlPosition _ctrlWatch) select 1, safeZoneY + (safeZoneH * 0.5)];
_ctrlWatch ctrlCommit 0;
_ctrlWatch ctrlAnimateModel ["WatchSecond", linearConversion [0, 60, floor ((daytime * 3600) % 60), 0, 1]];
_ctrlWatch ctrlAnimateModel ["WatchHour", (dayTime / 12) % 1];
_ctrlWatch ctrlAnimateModel ["WatchMinute", dayTime % 1];
};

true
4 changes: 2 additions & 2 deletions addons/medical_treatment/functions/fnc_cprProgress.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*
* Arguments:
* 0: Arguments <ARRAY>
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
* - 0: Medic <OBJECT>
* - 1: Patient <OBJECT>
*
* Return Value:
* Continue CPR <BOOL>
Expand Down
9 changes: 9 additions & 0 deletions addons/medical_treatment/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
true
] call CBA_fnc_addSetting;

[
QGVAR(enableRealisticPulseChecking),
"CHECKBOX",
[LSTRING(RealisticPulseChecking_DisplayName), LSTRING(RealisticPulseChecking_Description)],
[ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)],
true,
true
] call CBA_fnc_addSetting;

[
QGVAR(advancedBandages),
"LIST",
Expand Down
6 changes: 6 additions & 0 deletions addons/medical_treatment/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@
<Spanish>Habilita el manejo de la medicación más avanzada y en profundidad. Tambien permite el uso de Adenosina.</Spanish>
<Korean>더욱 더 확장된, 깊은 약물 치료를 활성화합니다. 또한 아데노신 기능을 활성화합니다.</Korean>
</Key>
<Key ID="STR_ACE_Medical_Treatment_RealisticPulseChecking_DisplayName">
<English>Realistic Pulse Checking</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_RealisticPulseChecking_Description">
<English>Enables realistic pulse checking, which requires a watch.</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_AdvancedBandages_DisplayName">
<English>Advanced Bandages</English>
<German>Erweiterte Bandagen</German>
Expand Down
Binary file added addons/medical_treatment/ui/checkPulse_ca.paa
Binary file not shown.