mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical Treatment - Realistic pulse checking
This commit is contained in:
parent
19523f028a
commit
bcf2feb394
@ -215,8 +215,11 @@ class GVAR(actions) {
|
||||
displayName = CSTRING(Actions_CheckPulse);
|
||||
displayNameProgress = CSTRING(Check_Pulse_Content);
|
||||
allowedSelections[] = {"All"};
|
||||
treatmentTime = 15;
|
||||
condition = QGVAR(advancedDiagnose);
|
||||
callbackSuccess = QFUNC(checkPulse);
|
||||
callbackProgress = QFUNC(checkPulseProgress);
|
||||
callbackFailure = QUOTE(QQGVAR(checkPulse) cutText [ARR_2('', 'PLAIN')];);
|
||||
animationMedicProne = "";
|
||||
animationMedicSelfProne = "";
|
||||
};
|
||||
@ -224,14 +227,21 @@ class GVAR(actions) {
|
||||
displayName = CSTRING(Actions_CheckBloodPressure);
|
||||
displayNameProgress = CSTRING(Check_Bloodpressure_Content);
|
||||
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
|
||||
treatmentTime = 15;
|
||||
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 -----------------------------------------------------------------
|
||||
|
31
addons/medical_treatment/RscTitles.hpp
Normal file
31
addons/medical_treatment/RscTitles.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
class RscWatch;
|
||||
class RscPicture;
|
||||
|
||||
class RscTitles {
|
||||
class GVAR(checkPulse) {
|
||||
idd = -1;
|
||||
enableSimulation = 1;
|
||||
onLoad = QUOTE(with uiNamespace do {GVAR(checkPulseDisplay) = _this # 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -15,6 +15,7 @@ PREP(checkBloodPressure);
|
||||
PREP(checkBloodPressureLocal);
|
||||
PREP(checkPulse);
|
||||
PREP(checkPulseLocal);
|
||||
PREP(checkPulseProgress);
|
||||
PREP(checkResponse);
|
||||
PREP(cprSuccess);
|
||||
PREP(cprFailure);
|
||||
|
@ -22,3 +22,4 @@ class CfgPatches {
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "Cfg3DEN.hpp"
|
||||
#include "RscTitles.hpp"
|
||||
|
@ -19,4 +19,6 @@
|
||||
|
||||
params ["_medic", "_patient", "_bodyPart"];
|
||||
|
||||
QGVAR(checkPulse) cutText ["", "PLAIN"];
|
||||
|
||||
[QGVAR(checkPulseLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent;
|
||||
|
@ -0,0 +1,47 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Pabst Mirror
|
||||
* ok
|
||||
*
|
||||
* Arguments:
|
||||
* 0,0: Medic <OBJECT>
|
||||
* 0,1: Patient <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [[player, cursorObject]] call ace_medical_treatment_fnc_checkPulse
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
(_this # 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 (time > _nextPulse) then { _display setVariable [QGVAR(lastPulse), _nextPulse]; };
|
||||
private _fade = (linearConversion [-.1, 0, CBA_missionTime - _nextPulse, 0, 0.85, true] max linearConversion [0.35, 0, CBA_missionTime - _lastPulse, 0, 0.75, true]) ^ 2;
|
||||
|
||||
private _ctrlVignette = _display displayCtrl 5000;
|
||||
_ctrlVignette ctrlSetTextColor [0,0,0,_fade];
|
||||
|
||||
private _ctrlWatch = _display displayCtrl 5001;
|
||||
_ctrlWatch ctrlSetPosition [safeZoneX + (safeZoneW * 0.5), (ctrlPosition _ctrlWatch) # 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
|
BIN
addons/medical_treatment/ui/checkPulse_ca.paa
Normal file
BIN
addons/medical_treatment/ui/checkPulse_ca.paa
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user