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

Medical GUI - Reformat injury list to clarify global vs. limb-specific information #9468

Merged
merged 5 commits into from
Oct 7, 2023
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
119 changes: 65 additions & 54 deletions addons/medical_gui/functions/fnc_updateInjuryList.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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]];
Expand All @@ -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 = [];

Expand Down Expand Up @@ -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;
};
Expand Down
6 changes: 6 additions & 0 deletions addons/medical_gui/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,9 @@
<Chinese>出血中</Chinese>
<Turkish>Kanama var</Turkish>
</Key>
<Key ID="STR_ACE_Medical_GUI_STATUS_NOBLEEDING">
<English>No bleeding</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_STATUS_PAIN">
<English>in Pain</English>
<German>hat Schmerzen</German>
Expand Down Expand Up @@ -1021,6 +1024,9 @@
<German>Schiene angelegt</German>
<Korean>부목 적용함</Korean>
</Key>
<Key ID="STR_ACE_Medical_GUI_Lost_Blood0">
<English>No blood loss</English>
</Key>
<!--Strings above match Blood2 but seem to differ in some languages, determine which is best to use-->
<Key ID="STR_ACE_Medical_GUI_Lost_Blood1">
<English>Lost some blood</English>
Expand Down
6 changes: 6 additions & 0 deletions addons/medical_treatment/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3417,6 +3417,9 @@
<Chinese>呼吸極弱</Chinese>
<Turkish>Neredeyse nefes almıyor</Turkish>
</Key>
<Key ID="STR_ACE_Medical_Treatment_Status_NoPain">
<English>No pain</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_Status_MildPain">
<English>In mild pain</English>
<German>Hat leichte Schmerzen</German>
Expand Down Expand Up @@ -3496,6 +3499,9 @@
<Chinesesimp>正在接受静脉注射 [%1毫升]</Chinesesimp>
<Chinese>接收靜脈注射液中 [%1毫升]</Chinese>
</Key>
<Key ID="STR_ACE_Medical_Treatment_Status_NoIv">
<English>No IV</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_Check_Bloodpressure">
<English>Blood Pressure</English>
<French>Tension artérielle</French>
Expand Down