From 242ebbe13a2fe93531597bf2e0c845a01dadd3d4 Mon Sep 17 00:00:00 2001 From: TheMagnetar Date: Wed, 18 Jul 2018 00:01:19 +0200 Subject: [PATCH 1/4] Improvements to vitals and display --- addons/medical/stringtable.xml | 9 ++++++++ .../fnc_displayPatientInformation.sqf | 20 ++++++++++++++++-- .../functions/fnc_updateUIInfo.sqf | 21 ++++++++++++++++--- .../functions/fnc_handleUnitVitals.sqf | 14 ++++++++----- 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 8d507f83e2f..799c9a21d10 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1031,6 +1031,15 @@ 大量失血中 大量失血中 + + Lost some blood Class II Hemorrhage + + + Lost a lot of blood Class III Hemorrhage + + + Lost a massive amount of blood Class IV Hemorrhage + Tourniquet [CAT] Tourniquet [CAT] diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 542d6e6df53..d8092fb46a9 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -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 { + if (GET_HEMORRHAGE(_target) == 1) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]]; + }; + + if (GET_HEMORRHAGE(_target) == 2) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]]; + }; + + if (GET_HEMORRHAGE(_target) == 3) then { + _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 { diff --git a/addons/medical_gui/functions/fnc_updateUIInfo.sqf b/addons/medical_gui/functions/fnc_updateUIInfo.sqf index 9e3ef543e92..54dc190012c 100644 --- a/addons/medical_gui/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_gui/functions/fnc_updateUIInfo.sqf @@ -1,4 +1,4 @@ -/* + /* * Author: Glowbal * Update all UI information in the medical menu * @@ -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 { + if (GET_HEMORRHAGE(_target) == 1) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]]; + }; + + if (GET_HEMORRHAGE(_target) == 2) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]]; + }; + + if (GET_HEMORRHAGE(_target) == 3) then { + _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 { diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index fa1c8b44e78..9b41fb5555f 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -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); @@ -92,6 +95,7 @@ if (_bloodLoss > BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) then { #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 From cb1e237c8c00aaf9b2e7b89de25c947c45c9110b Mon Sep 17 00:00:00 2001 From: TheMagnetar Date: Wed, 18 Jul 2018 00:05:14 +0200 Subject: [PATCH 2/4] Remove spaces --- addons/medical_gui/functions/fnc_updateUIInfo.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_gui/functions/fnc_updateUIInfo.sqf b/addons/medical_gui/functions/fnc_updateUIInfo.sqf index 54dc190012c..9e15bb5da22 100644 --- a/addons/medical_gui/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_gui/functions/fnc_updateUIInfo.sqf @@ -1,4 +1,4 @@ - /* +/* * Author: Glowbal * Update all UI information in the medical menu * From 86b8b2a61cd7246f2f9808b7b31d705cd388c3ef Mon Sep 17 00:00:00 2001 From: Glowbal Date: Wed, 18 Jul 2018 21:05:27 +0200 Subject: [PATCH 3/4] Use switch statements --- .../fnc_displayPatientInformation.sqf | 20 +++++++++---------- .../functions/fnc_updateUIInfo.sqf | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 6b131f4948c..c495070e77a 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -58,16 +58,16 @@ if (_show == 1) then { // Show more information if advancedDiagnose is enabled if (EGVAR(medical,advancedDiagnose)) then { - if (GET_HEMORRHAGE(_target) == 1) then { - _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]]; - }; - - if (GET_HEMORRHAGE(_target) == 2) then { - _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]]; - }; - - if (GET_HEMORRHAGE(_target) == 3) then { - _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood4), [1, 0.1, 0.1, 1]]; + 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 { diff --git a/addons/medical_gui/functions/fnc_updateUIInfo.sqf b/addons/medical_gui/functions/fnc_updateUIInfo.sqf index 81f4c951363..490c07bfb43 100644 --- a/addons/medical_gui/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_gui/functions/fnc_updateUIInfo.sqf @@ -33,16 +33,16 @@ if IS_BLEEDING(_target) then { // Show more information if advancedDiagnose is enabled if (EGVAR(medical,advancedDiagnose)) then { - if (GET_HEMORRHAGE(_target) == 1) then { - _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]]; - }; - - if (GET_HEMORRHAGE(_target) == 2) then { - _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]]; - }; - - if (GET_HEMORRHAGE(_target) == 3) then { - _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood4), [1, 0.1, 0.1, 1]]; + 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 { From 1b46515491285fcd53aaf14de20df2ba68ea9532 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Wed, 18 Jul 2018 21:06:15 +0200 Subject: [PATCH 4/4] Make the messages more vague --- addons/medical/stringtable.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index a3d703684c4..558982d9c61 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -18,13 +18,13 @@ 受傷 - Lost some blood Class II Hemorrhage + Lost some blood - Lost a lot of blood Class III Hemorrhage + Lost a lot of blood - Lost a massive amount of blood Class IV Hemorrhage + Lost a large amount of blood ACE Medical