-
Notifications
You must be signed in to change notification settings - Fork 749
Medical Treatment - Realistic pulse checking #7740
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
base: master
Are you sure you want to change the base?
Changes from all commits
bcf2feb
466f1bb
397826d
7f7fbf5
1ef4cd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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')]}}); | ||
| 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; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ----------------------------------------------------------------- | ||
|
|
||
| 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; | ||
| }; | ||
| }; | ||
| }; | ||
| }; |
| 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; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment.
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?