Medical GUI - Skip body part-specific info for medical peek (#9570)

* add no body part support to patient info

* move up one row

* header, comment
This commit is contained in:
Grim 2023-10-23 19:47:06 -04:00 committed by GitHub
parent 58e4476b7d
commit 0372447650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 6 deletions

View File

@ -6,7 +6,7 @@ class CfgVehicles {
displayName = CSTRING(Medical);
condition = QGVAR(enableSelfActions);
exceptions[] = {"isNotInside", "isNotSitting", "isNotSwimming"};
statement = QUOTE([ARR_2(_target,0)] call FUNC(displayPatientInformation));
statement = QUOTE([ARR_2(_target,-1)] call FUNC(displayPatientInformation));
runOnHover = 1;
icon = QPATHTOF(ui\cross.paa);
#define ACTION_CONDITION condition = "true";
@ -40,7 +40,7 @@ class CfgVehicles {
displayName = CSTRING(Medical);
condition = QUOTE((GVAR(enableActions) == 1 || {GVAR(enableActions) != 2 && {!isNull objectParent _target && {objectParent _target isEqualTo objectParent _player}}}));
exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE([ARR_2(_target,0)] call FUNC(displayPatientInformation));
statement = QUOTE([ARR_2(_target,-1)] call FUNC(displayPatientInformation));
runOnHover = 1;
icon = QPATHTOF(ui\cross.paa);
#define ACTION_CONDITION condition = "true";

View File

@ -80,7 +80,7 @@ GVAR(selfInteractionActions) = [];
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Statement
[ACE_player, 0] call FUNC(displayPatientInformation);
[ACE_player, -1] call FUNC(displayPatientInformation);
false
}, {
if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then {

View File

@ -18,7 +18,7 @@
#define MAX_DISTANCE 4
params ["_target", "_selectionN"];
params ["_target", ["_selectionN", -1]];
private _display = uiNamespace getVariable [QGVAR(RscPatientInfo), displayNull];
@ -34,7 +34,7 @@ if (isNull _display) then {
};
private _target = _display getVariable [QGVAR(target), objNull];
private _selectionN = _display getVariable [QGVAR(selectionN), 0];
private _selectionN = _display getVariable [QGVAR(selectionN), -1];
// Close display if target moved too far away (ignore if in same vehicle)
if (ACE_player distance _target > MAX_DISTANCE && {vehicle _target != vehicle ACE_player}) exitWith {

View File

@ -6,7 +6,7 @@
* Arguments:
* 0: Injury list <CONTROL>
* 1: Target <OBJECT>
* 2: Body part <NUMBER>
* 2: Body part, -1 to only show overall health info <NUMBER>
*
* Return Value:
* None
@ -102,6 +102,20 @@ if (_target call EFUNC(common,isAwake)) then {
};
};
// Skip the rest as they're body part specific
if (_selectionN == -1) exitWith {
// Add all entries to injury list
lbClear _ctrl;
{
_x params ["_text", "_color"];
_ctrl lbSetColor [_ctrl lbAdd _text, _color];
} forEach _entries;
_ctrl lbSetCurSel -1;
};
_entries pushBack ["", [1, 1, 1, 1]];
// Add selected body part name