Skip to content

Commit

Permalink
Start Basic Vitals
Browse files Browse the repository at this point in the history
  • Loading branch information
mazinskihenry committed Jan 14, 2025
1 parent 50bf5ac commit b7e717f
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 2 deletions.
14 changes: 14 additions & 0 deletions addons/vitals/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class ACE_Medical_Treatment_Actions {
class CheckPulse;
class BasicDiagnostic: CheckPulse {
displayName = CSTRING(basicDiagnostic_display);
displayNameProgress = CSTRING(basicDiagnostic_progress);
treatmentTime = QGVAR(basicDiagnosticTime);
category = "examine";
medicRequired = 0;
consumeItem = 0;
callbackSuccess = callbackSuccess = QFUNC(basicDiagnostic);
condition = QUOTE(missionNamespace getVariable [ARR_2(QQGVAR(enableBasicDiagnostic),false)]);
items[] = {"kat_basicDiagnostic"};
};
};
14 changes: 14 additions & 0 deletions addons/vitals/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CfgWeapons {
class ACE_ItemCore;
class kat_basicDiagnostic: ACE_ItemCore {
scope = 2;
author = "Mazinski";
displayName = CSTRING(basicDiagnostic_display);
descriptionShort = CSTRING(basicDiagnostic_description);
picture = QPATHTOF(ui\BPCuff.paa); // FLAG
icon = "";
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 8;
};
};
};
2 changes: 2 additions & 0 deletions addons/vitals/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
PREP(addMedicationAdjustment);
PREP(basicDiagnostic);
PREP(basicDiagnosticLocal);
PREP(fullHealLocal);
PREP(handleUnitVitals);
PREP(handleSimpleVitals);
Expand Down
2 changes: 2 additions & 0 deletions addons/vitals/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "script_component.hpp"

[QGVAR(basicDiagnosticLocal), LINKFUNC(basicDiagnosticLocal)] call CBA_fnc_addEventHandler;

[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler;
18 changes: 18 additions & 0 deletions addons/vitals/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,22 @@ PREP_RECOMPILE_END;
true
] call CBA_Settings_fnc_init;

[
QGVAR(enableBasicDiagnostic),
"CHECKBOX",
LLSTRING(BASIC_DIAGNOSTIC_ENABLE),
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)],
[false],
true
] call CBA_Settings_fnc_init;

[
QGVAR(basicDiagnosticTime),
"SLIDER",
LLSTRING(BASIC_DIAGNOSTIC_TIME),
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)],
[0.1, 60, 15, 1],
true
] call CBA_Settings_fnc_init;

ADDON = true;
8 changes: 6 additions & 2 deletions addons/vitals/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ class CfgPatches {
name = COMPONENT_NAME;
requiredVersion = REQUIRED_VERSION;
units[] = {};
weapons[] = {};
weapons[] = {
"kat_basicDiagnostic"
};
magazines[] = {};
requiredAddons[] = {
"ace_medical",
Expand All @@ -30,4 +32,6 @@ class CfgPatches {
};

#include "CfgEventHandlers.hpp"
#include "CfgFunctions.hpp"
#include "CfgFunctions.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Medical_Treatment_Actions.hpp"
21 changes: 21 additions & 0 deletions addons/vitals/functions/fnc_basicDiagnostic.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "..\script_component.hpp"
/*
* Author: Mazinski
* Checks all basic patient vitals (HR/BP/RR)
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, cursorObject] call kat_vitals_fnc_basicDiagnostic
*
* Public: No
*/

params ["_medic", "_patient"];

[QGVAR(basicDiagnosticLocal), [_medic, _patient], _patient] call CBA_fnc_targetEvent;
28 changes: 28 additions & 0 deletions addons/vitals/functions/fnc_basicDiagnosticLocal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "..\script_component.hpp"
/*
* Author: Mazinski
* Local callback for checking all basic patient vitals (HR/BP/RR)
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, cursorObject] call kat_vitals_fnc_basicDiagnosticLocal
*
* Public: No
*/

params ["_medic", "_patient"];

private _bloodPressure = GET_BLOOD_PRESSURE(unit)
private _hr = GET_HEART_RATE(_patient);
private _rr = GET_BREATHING_RATE(unit)

_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"];
_logOutput = format [LLSTRING(BasicDiagnostic_Output), _hr, _bloodPressureHigh, _bloodPressureLow, _rr];

[_patient, "quick_view", LSTRING(basicDiagnostic_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog);
27 changes: 27 additions & 0 deletions addons/vitals/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,32 @@
<French>Permettre le transfert de fluide du patient</French>
<Chinesesimp>启用患者液体转移</Chinesesimp>
</Key>
<Key ID="STR_KAT_Vitals_BASIC_DIAGNOSTIC_ENABLE">
<English>Enable Basic Vitals Kit</English>
</Key>
<Key ID="STR_KAT_Vitals_BASIC_DIAGNOSTIC_TIME">
<English>Basic Vitals Kit Time</English>
</Key>
<Key ID="STR_KAT_Vitals_basicDiagnostic_display">
<English>Basic Vitals Kit</English>
</Key>
<Key ID="STR_KAT_Vitals_basicDiagnostic_description">
<English>Vitals Kit which returns HR, BP, and RR</English>
</Key>
<Key ID="STR_KAT_Vitals_basicDiagnostic_display">
<English>Use Basic Vitals Kit</English>
</Key>
<Key ID="STR_KAT_Vitals_basicDiagnostic_progress">
<English>Assessing Patient...</English>
</Key>
<Key ID="STR_KAT_Vitals_basicDiagnostic_description">
<English>Vitals Kit which returns HR, BP, and RR</English>
</Key>
<Key ID="STR_KAT_Vitals_BasicDiagnostic_Output">
<English>HR: %1, BP: %2/%3, RR: %4</English>
</Key>
<Key ID="STR_KAT_Vitals_basicDiagnostic_Log">
<English>%1 - %2</English>
</Key>
</Package>
</Project>

0 comments on commit b7e717f

Please sign in to comment.