ACE3/addons/medical_gui/functions/fnc_modifyActionTriageLevel.sqf
Brett 78c307196d
Medical - Show triage level in interaction (#7940)
* medical: show triage in interaction

* rename

* clean up comments

* Update addons/medical_gui/functions/fnc_modifyActionTriageLevel.sqf

Co-authored-by: jonpas <jonpas33@gmail.com>

* Update addons/medical_gui/functions/fnc_modifyActionTriageLevel.sqf

Co-authored-by: jonpas <jonpas33@gmail.com>

* Add setting (disabled, enabled, medicsOnly)

* Apply suggestions from code review

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2020-10-28 19:08:00 -05:00

47 lines
1.2 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: SynixeBrett
* Modifies the action color to match the triage level.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
* 2: Args <ANY>
* 3: Action Data <ARRAY>
*
* Return Value:
* None
*
* Example:
* [cursorObject, player, [], []] call ace_interaction_fnc_modifyActionTriageLevel
*
* Public: No
*/
params ["_target", "_player", "", "_actionData"];
if (
GVAR(interactionMenuShowTriage) == 1 // Anyone
|| {GVAR(interactionMenuShowTriage) == 2 && {[_player] call EFUNC(medical_treatment,isMedic)}} // Medics & Doctors
) then {
private _colorHex = switch (_target getVariable [QEGVAR(medical,triageLevel), 0]) do {
case 1: {
[TRIAGE_COLOR_MINIMAL] call BIS_fnc_colorRGBtoHTML
};
case 2: {
[TRIAGE_COLOR_DELAYED] call BIS_fnc_colorRGBtoHTML
};
case 3: {
[TRIAGE_COLOR_IMMEDIATE] call BIS_fnc_colorRGBtoHTML
};
case 4: {
[TRIAGE_COLOR_DECEASED] call BIS_fnc_colorRGBtoHTML
};
default {
"#FFFFFF"
};
};
_actionData params ["", "", "_icon"];
_icon set [1, _colorHex];
};