2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-15 10:23:47 +00:00
|
|
|
/*
|
2019-03-24 22:17:48 +00:00
|
|
|
* Author: Glowbal, mharis001
|
|
|
|
* Opens the patient information display for given target.
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2019-03-24 22:17:48 +00:00
|
|
|
* 0: Target <OBJECT>
|
|
|
|
* 1: Body part <NUMBER>
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2016-07-15 10:23:47 +00:00
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
2019-03-24 22:17:48 +00:00
|
|
|
* [_target, 0] call ace_medical_gui_fnc_displayPatientInformation
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
2016-07-15 10:23:47 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
#define MAX_DISTANCE 4
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
params ["_target", "_selectionN"];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
private _display = uiNamespace getVariable [QGVAR(RscPatientInfo), displayNull];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
if (isNull _display) then {
|
|
|
|
QGVAR(RscPatientInfo) cutRsc [QGVAR(RscPatientInfo), "PLAIN", -1, false];
|
|
|
|
_display = uiNamespace getVariable [QGVAR(RscPatientInfo), displayNull];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
[{
|
|
|
|
params ["_display", "_pfhID"];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
if (isNull _display) exitWith {
|
|
|
|
[_pfhID] call CBA_fnc_removePerFrameHandler;
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
private _target = _display getVariable [QGVAR(target), objNull];
|
|
|
|
private _selectionN = _display getVariable [QGVAR(selectionN), 0];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
// 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 {
|
|
|
|
[_pfhID] call CBA_fnc_removePerFrameHandler;
|
|
|
|
QGVAR(RscPatientInfo) cutFadeOut 0.3;
|
|
|
|
[[ELSTRING(medical,DistanceToFar), _target call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured);
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
// Update body image
|
|
|
|
private _ctrlBodyImage = _display displayCtrl IDC_BODY_GROUP;
|
|
|
|
[_ctrlBodyImage, _target] call FUNC(updateBodyImage);
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
// Update injury list
|
|
|
|
private _ctrlInjuries = _display displayCtrl IDC_INJURIES;
|
|
|
|
[_ctrlInjuries, _target, _selectionN] call FUNC(updateInjuryList);
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
// Update activity log
|
|
|
|
private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY;
|
2019-06-03 15:31:46 +00:00
|
|
|
private _activityLog = _target getVariable [MED_LOG_VARNAME("activity"), []];
|
2019-03-24 22:17:48 +00:00
|
|
|
[_ctrlActivityLog, _activityLog] call FUNC(updateLogList);
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
// Update triage status
|
|
|
|
[_display, _target] call FUNC(updateTriageStatus);
|
|
|
|
}, 0, _display] call CBA_fnc_addPerFrameHandler;
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
2019-03-24 22:17:48 +00:00
|
|
|
|
|
|
|
_display setVariable [QGVAR(target), _target];
|
|
|
|
_display setVariable [QGVAR(selectionN), _selectionN];
|