ACE3/addons/medical_gui/functions/fnc_damageToRGBA.sqf
Serg Vergun f7b07c362d
Medical GUI - Add ability to customize Medical GUI colors (#8350)
* Add ability to customize colors of injuries

Added CBA settings entries.
Updated default values.
Added English and Russian locales.

* copypaste cleanup

* move comments and make code more maintainable

* Apply suggestions from code review

Newline at end of files

Co-authored-by: Dedmen Miller <dedmen@users.noreply.github.com>

Co-authored-by: Dedmen Miller <dedmen@users.noreply.github.com>
2021-10-12 10:11:55 +02:00

24 lines
557 B
Plaintext

#include "script_component.hpp"
/*
* Author: ShackTac, SilentSpike
* Converts a damage value into a representative RGBA colour.
*
* Arguments:
* 0: The damage value (range [0,1]) <NUMBER>
*
* Return Value:
* Representative RGBA colour <ARRAY>
*
* Example:
* [0.4] call ace_medical_gui_fnc_damageToRGBA
*
* Public: No
*/
params ["_damage"];
private _frD = 0 max (_damage / DAMAGE_BLUE_THRESHOLD) min 1;
private _colorInt = ceil (_frD * (DAMAGE_TOTAL_COLORS - 1));
missionNamespace getVariable format ["%1_%2", QGVAR(damageColor), _colorInt]