2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-14 15:49:10 +00:00
|
|
|
/*
|
2023-08-16 23:18:01 +00:00
|
|
|
* Author: tcvm
|
2021-10-14 15:49:10 +00:00
|
|
|
* Run once per second in a PFH. Update screen effects with burn indicator.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit on fire <OBJECT>
|
|
|
|
* 1: PFH Handle <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-06-22 18:07:36 +00:00
|
|
|
* [player, _pfhID] call ace_fire_fnc_burnIndicator
|
2021-10-14 15:49:10 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
params ["_unit", "_pfhID"];
|
2021-10-14 15:49:10 +00:00
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
if (!alive _unit || {!(_unit call FUNC(isBurning))}) exitWith {
|
|
|
|
_pfhID call CBA_fnc_removePerFrameHandler;
|
|
|
|
|
|
|
|
_unit setVariable [QGVAR(burnUIPFH), nil];
|
2021-10-14 15:49:10 +00:00
|
|
|
};
|
|
|
|
|
2024-06-22 18:07:36 +00:00
|
|
|
// Don't show burn overlay if unconscious or dead
|
|
|
|
if !(_unit call EFUNC(common,isAwake)) exitWith {};
|
|
|
|
|
|
|
|
private _iteration = _unit getVariable [QGVAR(indicatorIteration), 0];
|
|
|
|
|
|
|
|
if (_iteration == 0) then {
|
|
|
|
QGVAR(indicatorLayer) cutRsc [QGVAR(onFire1), "PLAIN"];
|
|
|
|
_iteration = 1;
|
|
|
|
} else {
|
|
|
|
QGVAR(indicatorLayer) cutRsc [QGVAR(onFire2), "PLAIN"];
|
|
|
|
_iteration = 0;
|
2021-10-14 15:49:10 +00:00
|
|
|
};
|
2024-06-22 18:07:36 +00:00
|
|
|
|
|
|
|
_unit setVariable [QGVAR(indicatorIteration), _iteration];
|