diff --git a/addons/medical_gui/CfgVehicles.hpp b/addons/medical_gui/CfgVehicles.hpp index 8abfe9f067..e300af12c1 100644 --- a/addons/medical_gui/CfgVehicles.hpp +++ b/addons/medical_gui/CfgVehicles.hpp @@ -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"; diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 7f89dca28c..f2777f6fd4 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -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 { diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 83ab7ba3f0..65660eec79 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -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 { diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index 8a09647740..328e80242a 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -6,7 +6,7 @@ * Arguments: * 0: Injury list * 1: Target - * 2: Body part + * 2: Body part, -1 to only show overall health info * * 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