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 - Show warning if tourniquet will interfere with medical menu action #9475

Merged
merged 6 commits into from
Oct 14, 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
11 changes: 11 additions & 0 deletions addons/medical_gui/functions/fnc_updateActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 9 additions & 0 deletions addons/medical_gui/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
false
true

Global

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh really? It seems like something that would be left to the player unless admins specifically care. That's my assumption for UI stuff in general.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh really? It seems like something that would be left to the player unless admins specifically care. That's my assumption for UI stuff in general.

I agree with this. @LinkIsGrim Why would you want to enforce it globally?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the effect, I'd rather this be really deliberate on when it's enabled.

That being said, vox populi and all that.

Copy link
Contributor

@Drofseh Drofseh Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be global. Community admins can force if they want to.

] call CBA_fnc_addSetting;
9 changes: 9 additions & 0 deletions addons/medical_gui/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>