Skip to content
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

Improvements to vitals and display #6444

Merged
merged 5 commits into from
Jul 18, 2018
Merged
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
9 changes: 9 additions & 0 deletions addons/medical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<Chinesesimp>受伤</Chinesesimp>
<Chinese>受傷</Chinese>
</Key>
<Key ID="STR_ACE_Medical_Status_Lost_Blood2">
<English>Lost some blood</English>
</Key>
<Key ID="STR_ACE_Medical_Status_Lost_Blood3">
<English>Lost a lot of blood</English>
</Key>
<Key ID="STR_ACE_Medical_Status_Lost_Blood4">
<English>Lost a large amount of blood</English>
</Key>
<Key ID="STR_ACE_Medical_Category_DisplayName">
<English>ACE Medical</English>
<Russian>ACE: медицина</Russian>
Expand Down
20 changes: 18 additions & 2 deletions addons/medical_gui/functions/fnc_displayPatientInformation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,24 @@ if (_show == 1) then {
if IS_BLEEDING(_target) then {
_genericMessages pushback [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]];
};
if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushback [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];

// Show more information if advancedDiagnose is enabled
if (EGVAR(medical,advancedDiagnose)) then {
switch (GET_HEMORRHAGE(_target)) do {
case 1: {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]];
};
case 2: {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]];
};
case 3: {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood4), [1, 0.1, 0.1, 1]];
};
};
} else {
if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
};
};

if (((_target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then {
Expand Down
19 changes: 17 additions & 2 deletions addons/medical_gui/functions/fnc_updateUIInfo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,23 @@ if IS_BLEEDING(_target) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]];
};

if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
// Show more information if advancedDiagnose is enabled
if (EGVAR(medical,advancedDiagnose)) then {
switch (GET_HEMORRHAGE(_target)) do {
case 1: {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]];
};
case 2: {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]];
};
case 3: {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood4), [1, 0.1, 0.1, 1]];
};
};
} else {
if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
};
};

if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) select _selectionN) > 0) then {
Expand Down
14 changes: 9 additions & 5 deletions addons/medical_vitals/functions/fnc_handleUnitVitals.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME;
_unit setVariable [VAR_BLOOD_VOL, _bloodVolume, _syncValues];

// Set variables for synchronizing information across the net
private _hemorrhage = [
0,
[1, 3] select (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE)
] select (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE);
private _hemorrhage = switch (true) do {
case (_bloodVolume < BLOOD_VOLUME_CLASS_4_HEMORRHAGE): { 3 };
case (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE): { 2 };
case (_bloodVolume < BLOOD_VOLUME_CLASS_2_HEMORRHAGE): { 1 };
case (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE): { 1 };
default {0};
};

if (_hemorrhage != GET_HEMORRHAGE(_unit)) then {
_unit setVariable [VAR_HEMORRHAGE, _hemorrhageClass, true];
_unit setVariable [VAR_HEMORRHAGE, _hemorrhage, true];
};

private _bloodLoss = GET_BLOOD_LOSS(_unit);
Expand Down Expand Up @@ -122,6 +125,7 @@ switch (true) do {

#ifdef DEBUG_MODE_FULL
if (!isPlayer _unit) then {
private _painLevel = _unit getVariable [VAR_PAIN, 0];
hintSilent format["blood volume: %1, blood loss: [%2, %3]\nhr: %4, bp: %5, pain: %6", round(_bloodVolume * 100) / 100, round(_bloodLoss * 1000) / 1000, round((_bloodLoss / (0.001 max _cardiacOutput)) * 100) / 100, round(_heartRate), _bloodPressure, round(_painLevel * 100) / 100];
};
#endif
Expand Down