From 78bb0514d1233712428da023cdc732c037ed8aeb Mon Sep 17 00:00:00 2001 From: amsteadrayle <2516219+amsteadrayle@users.noreply.github.com> Date: Sat, 7 Oct 2023 12:25:41 -0400 Subject: [PATCH] Medical GUI - Reformat injury list to clarify global vs. limb-specific information (#9468) * Reorder injury list to clarify global vs. local * Add non-issue entries and deemphasize with color * Give non-issue color to "No injuries..." entry * Hook up to string tables * move bleeding above blood volume lost --------- Co-authored-by: LinkIsGrim --- .../functions/fnc_updateInjuryList.sqf | 119 ++++++++++-------- addons/medical_gui/stringtable.xml | 6 + addons/medical_treatment/stringtable.xml | 6 + 3 files changed, 77 insertions(+), 54 deletions(-) diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index 85c87cec7e..8a0d066170 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -20,6 +20,70 @@ params ["_ctrl", "_target", "_selectionN"]; private _entries = []; +private _nonissueColor = [1, 1, 1, 0.33]; + +// Indicate if unit is bleeding at all +if (IS_BLEEDING(_target)) then { + _entries pushBack [localize LSTRING(Status_Bleeding), [1, 0, 0, 1]]; +} else { + _entries pushBack [localize LSTRING(Status_Nobleeding), _nonissueColor]; +}; + +if (GVAR(showBloodlossEntry)) then { + // Give a qualitative description of the blood volume lost + switch (GET_HEMORRHAGE(_target)) do { + case 0: { + _entries pushBack [localize LSTRING(Lost_Blood0), _nonissueColor]; + }; + case 1: { + _entries pushBack [localize LSTRING(Lost_Blood1), [1, 1, 0, 1]]; + }; + case 2: { + _entries pushBack [localize LSTRING(Lost_Blood2), [1, 0.67, 0, 1]]; + }; + case 3: { + _entries pushBack [localize LSTRING(Lost_Blood3), [1, 0.33, 0, 1]]; + }; + case 4: { + _entries pushBack [localize LSTRING(Lost_Blood4), [1, 0, 0, 1]]; + }; + }; +}; +// Show receiving IV volume remaining +private _totalIvVolume = 0; +{ + _x params ["_volumeRemaining"]; + _totalIvVolume = _totalIvVolume + _volumeRemaining; +} forEach (_target getVariable [QEGVAR(medical,ivBags), []]); + +if (_totalIvVolume >= 1) then { + _entries pushBack [format [localize ELSTRING(medical_treatment,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; +} else { + _entries pushBack [localize ELSTRING(medical_treatment,Status_NoIv), _nonissueColor]; +}; + +// Indicate the amount of pain the unit is in +if (_target call EFUNC(common,isAwake)) then { + private _pain = GET_PAIN_PERCEIVED(_target); + if (_pain > 0) then { + private _painText = switch (true) do { + case (_pain > PAIN_UNCONSCIOUS): { + ELSTRING(medical_treatment,Status_SeverePain); + }; + case (_pain > (PAIN_UNCONSCIOUS / 5)): { + ELSTRING(medical_treatment,Status_Pain); + }; + default { + ELSTRING(medical_treatment,Status_MildPain); + }; + }; + _entries pushBack [localize _painText, [1, 1, 1, 1]]; + } else { + _entries pushBack [localize ELSTRING(medical_treatment,Status_NoPain), _nonissueColor]; + }; +}; + +_entries pushBack ["", [1, 1, 1, 1]]; // Add selected body part name private _bodyPartName = [ @@ -70,29 +134,6 @@ if (GVAR(showDamageEntry)) then { }; }; -// Indicate if unit is bleeding at all -if (IS_BLEEDING(_target)) then { - _entries pushBack [localize LSTRING(Status_Bleeding), [1, 0, 0, 1]]; -}; - -if (GVAR(showBloodlossEntry)) then { - // Give a qualitative description of the blood volume lost - switch (GET_HEMORRHAGE(_target)) do { - case 1: { - _entries pushBack [localize LSTRING(Lost_Blood1), [1, 1, 0, 1]]; - }; - case 2: { - _entries pushBack [localize LSTRING(Lost_Blood2), [1, 0.67, 0, 1]]; - }; - case 3: { - _entries pushBack [localize LSTRING(Lost_Blood3), [1, 0.33, 0, 1]]; - }; - case 4: { - _entries pushBack [localize LSTRING(Lost_Blood4), [1, 0, 0, 1]]; - }; - }; -}; - // Indicate if a tourniquet is applied if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then { _entries pushBack [localize LSTRING(Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; @@ -110,36 +151,6 @@ switch (GET_FRACTURES(_target) select _selectionN) do { }; }; -// Indicate the amount of pain the unit is in -if (_target call EFUNC(common,isAwake)) then { - private _pain = GET_PAIN_PERCEIVED(_target); - if (_pain > 0) then { - private _painText = switch (true) do { - case (_pain > PAIN_UNCONSCIOUS): { - ELSTRING(medical_treatment,Status_SeverePain); - }; - case (_pain > (PAIN_UNCONSCIOUS / 5)): { - ELSTRING(medical_treatment,Status_Pain); - }; - default { - ELSTRING(medical_treatment,Status_MildPain); - }; - }; - _entries pushBack [localize _painText, [1, 1, 1, 1]]; - }; -}; - -// Show receiving IV volume remaining -private _totalIvVolume = 0; -{ - _x params ["_volumeRemaining"]; - _totalIvVolume = _totalIvVolume + _volumeRemaining; -} forEach (_target getVariable [QEGVAR(medical,ivBags), []]); - -if (_totalIvVolume >= 1) then { - _entries pushBack [format [localize ELSTRING(medical_treatment,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; -}; - // Add entries for open, bandaged, and stitched wounds private _woundEntries = []; @@ -174,7 +185,7 @@ private _fnc_processWounds = { // Handle no wound entries if (_woundEntries isEqualTo []) then { - _entries pushBack [localize ELSTRING(medical_treatment,NoInjuriesBodypart), [1, 1, 1, 1]]; + _entries pushBack [localize ELSTRING(medical_treatment,NoInjuriesBodypart), _nonissueColor]; } else { _entries append _woundEntries; }; diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index b659dac338..c2eb8c8e73 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -957,6 +957,9 @@ 出血中 Kanama var + + No bleeding + in Pain hat Schmerzen @@ -1021,6 +1024,9 @@ Schiene angelegt 부목 적용함 + + No blood loss + Lost some blood diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 0f3694a49f..0c0a20e2f8 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -3417,6 +3417,9 @@ 呼吸極弱 Neredeyse nefes almıyor + + No pain + In mild pain Hat leichte Schmerzen @@ -3496,6 +3499,9 @@ 正在接受静脉注射 [%1毫升] 接收靜脈注射液中 [%1毫升] + + No IV + Blood Pressure Tension artérielle