Medical GUI - Show warning if tourniquet will interfere with medical menu action (#9475)

* Warn if tourniquet will interfere with medical action

* Add setting to enable, default to off

* Tweak tooltip message

* Tweak code style, missing semicolon

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Use localize macro

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
amsteadrayle 2023-10-14 19:28:22 -04:00 committed by GitHub
parent b54be029df
commit c54a26cc42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

View File

@ -58,8 +58,19 @@ private _shownIndex = 0;
private _counts = [_items] call FUNC(countTreatmentItems);
_countText = _counts call FUNC(formatItemCounts);
};
_ctrl ctrlSetTooltipColorText [1, 1, 1, 1];
_ctrl ctrlSetTooltip _countText;
// Show warning if tourniquet will interfere with action
if (
GVAR(tourniquetWarning) &&
{(_category in ["examine", "medication"]) || (_items findIf {"IV" in _x}) > -1} &&
{HAS_TOURNIQUET_APPLIED_ON(GVAR(target),GVAR(selectedBodyPart))}
) then {
_ctrl ctrlSetTooltipColorText [1, 1, 0, 1];
_ctrl ctrlSetTooltip LLSTRING(TourniquetWarning);
};
_ctrl ctrlSetText _displayName;
_ctrl ctrlShow true;

View File

@ -162,3 +162,12 @@ private _categoryColors = [ELSTRING(medical,Category), format ["| %1 |", LELSTRI
[0, 5, 1],
false
] call CBA_fnc_addSetting;
[
QGVAR(tourniquetWarning),
"CHECKBOX",
[LSTRING(TourniquetWarning_DisplayName), LSTRING(TourniquetWarning_Description)],
[ELSTRING(medical,Category), LSTRING(SubCategory)],
false,
false
] call CBA_fnc_addSetting;

View File

@ -1348,5 +1348,14 @@
<Key ID="STR_ACE_Medical_GUI_TreatmentItemCount_Vehicle">
<English>in vehicle's inventory</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_TourniquetWarning">
<English>No effect until tourniquet removed</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_TourniquetWarning_DisplayName">
<English>Show Tourniquet Warning</English>
</Key>
<Key ID="STR_ACE_Medical_GUI_TourniquetWarning_Description">
<English>Show a warning tooltip when a tourniquet will interfere with a medical action.</English>
</Key>
</Package>
</Project>