diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index cd61550152..e181328318 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -13,6 +13,7 @@ */ #include "script_component.hpp" +#define MAX_DISTANCE 10 // Exit for basic medical if (GVAR(level) < 2) exitWith {}; @@ -39,6 +40,11 @@ if (_show) then { if (GVAR(displayPatientInformationTarget) != _target || GVAR(currentSelectedSelectionN) != _selectionN) exitwith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; + if (ACE_player distance _target > MAX_DISTANCE) exitwith { + ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + ["displayTextStructured", [ACE_player], [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + }; disableSerialization; _display = uiNamespace getvariable QGVAR(DisplayInformation); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 75650e36da..acda7ad5b3 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3612,5 +3612,8 @@ Médico Orvosi + + Distance to %1 has become to far for treatment + diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 52a957ae93..9c4d1865fa 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -14,6 +14,7 @@ * Public: No */ #include "script_component.hpp" +#define MAX_DISTANCE 10 private "_target"; @@ -72,6 +73,12 @@ setMousePosition [0.4, 0.4]; _status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus); (_display displayCtrl 2000) ctrlSetText (_status select 0); (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); + + if (ACE_player distance _target > MAX_DISTANCE) exitwith { + closeDialog 314412; + ["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + }; + }, [_display]] call BIS_fnc_addStackedEventHandler; ["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call EFUNC(common,localEvent);