2023-09-12 18:58:10 +00:00
#include "..\script_component.hpp"
2019-03-24 22:17:48 +00:00
/*
* Author: mharis001
* Handles updating the Medical Menu UI for the current target.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_medical_gui_fnc_menuPFH
*
* Public: No
*/
// Check if menu should stay open for target
2023-11-20 21:52:29 +00:00
if !(
([ACE_player, GVAR(target), ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith) || {!isNull findDisplay 312}) && // Allow player to look at himself when unconsious and in Zeus
{[ACE_player, GVAR(target)] call FUNC(canOpenMenu)}
) then {
2019-03-24 22:17:48 +00:00
closeDialog 0;
// Show hint if distance condition failed
2019-07-03 15:40:42 +00:00
if ((ACE_player distance GVAR(target) > GVAR(maxDistance)) && {vehicle ACE_player != vehicle GVAR(target)}) then {
2019-03-24 22:17:48 +00:00
[[ELSTRING(medical,DistanceToFar), GVAR(target) call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured);
};
};
// Get the Medical Menu display
private _display = uiNamespace getVariable [QGVAR(menuDisplay), displayNull];
if (isNull _display) exitWith {};
// Update treatment category buttons
[_display] call FUNC(updateCategories);
// Update treatment actions for current category
[_display] call FUNC(updateActions);
// Update injury list
private _ctrlInjuries = _display displayCtrl IDC_INJURIES;
[_ctrlInjuries, GVAR(target), GVAR(selectedBodyPart)] call FUNC(updateInjuryList);
// Update body image
private _ctrlBodyImage = _display displayCtrl IDC_BODY_GROUP;
2023-10-11 09:25:28 +00:00
[_ctrlBodyImage, GVAR(target), GVAR(selectedBodyPart)] call FUNC(updateBodyImage);
2019-03-24 22:17:48 +00:00
// Update activity and quick view logs
private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY;
2019-06-03 15:31:46 +00:00
private _activityLog = GVAR(target) getVariable [MED_LOG_VARNAME("activity"), []];
2019-03-24 22:17:48 +00:00
[_ctrlActivityLog, _activityLog] call FUNC(updateLogList);
private _ctrlQuickView = _display displayCtrl IDC_QUICKVIEW;
2019-06-03 15:31:46 +00:00
private _quickView = GVAR(target) getVariable [MED_LOG_VARNAME("quick_view"), []];
2019-03-24 22:17:48 +00:00
[_ctrlQuickView, _quickView] call FUNC(updateLogList);
// Update triage status
[_display, GVAR(target)] call FUNC(updateTriageStatus);