2015-08-06 21:51:17 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Update the body image on the menu
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: selection bloodloss <ARRAY>
|
2015-10-13 07:01:59 +00:00
|
|
|
* 1: damaged (array of bools) <ARRAY>
|
|
|
|
* 2: display <DISPLAY>
|
2015-08-06 21:51:17 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-07 03:37:41 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-10-13 07:01:59 +00:00
|
|
|
* [0.3, some_display] call ace_medical_menu_fnc_updateBodyImage
|
2015-08-06 21:51:17 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-10-13 07:01:59 +00:00
|
|
|
params ["_selectionBloodLoss", "_damaged", "_display"];
|
2015-08-06 21:51:17 +00:00
|
|
|
|
|
|
|
// Handle the body image coloring
|
2015-11-17 16:43:07 +00:00
|
|
|
private _availableSelections = [50, 51, 52, 53, 54, 55];
|
2015-08-06 21:51:17 +00:00
|
|
|
{
|
2016-06-13 10:49:35 +00:00
|
|
|
private _red = 1;
|
|
|
|
private _green = 1;
|
|
|
|
private _blue = 1;
|
2015-08-07 03:37:41 +00:00
|
|
|
|
|
|
|
if (_x > 0) then {
|
2015-08-06 21:51:17 +00:00
|
|
|
if (_damaged select _forEachIndex) then {
|
2015-08-07 03:37:41 +00:00
|
|
|
_green = (0.9 - _x) max 0;
|
2015-08-06 21:51:17 +00:00
|
|
|
_blue = _green;
|
|
|
|
} else {
|
2015-08-07 03:37:41 +00:00
|
|
|
_green = (0.9 - _x) max 0;
|
2015-08-06 21:51:17 +00:00
|
|
|
_red = _green;
|
|
|
|
//_blue = _green;
|
|
|
|
};
|
|
|
|
};
|
2015-08-07 03:37:41 +00:00
|
|
|
|
|
|
|
(_display displayCtrl (_availableSelections select _forEachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0];
|
|
|
|
} forEach _selectionBloodLoss;
|