2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-06-09 01:34:29 +00:00
|
|
|
/*
|
|
|
|
* Author: TheDrill, PabstMirror
|
|
|
|
* The perFrameEventHandler to draw the icons
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [fromCBA] call ace_finger_fnc_perFrameEH;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2021-10-10 16:55:14 +00:00
|
|
|
if (!alive ACE_player) then {GVAR(fingersHash) = createHashMap};
|
2015-06-09 01:34:29 +00:00
|
|
|
// Conditions: canInteract
|
2021-10-10 16:55:14 +00:00
|
|
|
if !([ACE_player, ACE_player, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = createHashMap};
|
2016-06-25 19:02:06 +00:00
|
|
|
// Make sure player is dismounted or in a static weapon:
|
2021-10-10 16:55:14 +00:00
|
|
|
if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = createHashMap};
|
2015-06-09 01:34:29 +00:00
|
|
|
|
2016-06-25 19:02:06 +00:00
|
|
|
private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom));
|
2015-06-09 01:34:29 +00:00
|
|
|
|
2021-10-10 16:55:14 +00:00
|
|
|
{
|
|
|
|
//IGNORE_PRIVATE_WARNING ["_x", "_y"];
|
|
|
|
_y params ["_lastTime", "_pos", "_name"];
|
2016-06-25 19:02:06 +00:00
|
|
|
private _timeLeftToShow = _lastTime + FP_TIMEOUT - diag_tickTime;
|
2015-06-09 01:34:29 +00:00
|
|
|
if (_timeLeftToShow <= 0) then {
|
2021-10-10 16:55:14 +00:00
|
|
|
GVAR(fingersHash) deleteAt _x;
|
2015-06-09 01:34:29 +00:00
|
|
|
} else {
|
2016-06-25 19:02:06 +00:00
|
|
|
private _drawColor = + GVAR(indicatorColor);
|
|
|
|
// Fade out:
|
|
|
|
_drawColor set [3, ((_drawColor select 3) * ((_timeLeftToShow min 0.5) / 0.5))];
|
2015-06-09 01:34:29 +00:00
|
|
|
|
2016-06-25 19:02:06 +00:00
|
|
|
drawIcon3D [QPATHTOF(UI\fp_icon2.paa), _drawColor, ASLtoAGL _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "RobotoCondensed"];
|
2015-06-09 01:34:29 +00:00
|
|
|
};
|
2021-10-10 16:55:14 +00:00
|
|
|
} forEach GVAR(fingersHash);
|
2015-06-09 01:34:29 +00:00
|
|
|
|
2021-10-10 16:55:14 +00:00
|
|
|
if (GVAR(fingersHash) isEqualTo createHashMap) then {
|
2016-07-30 17:28:07 +00:00
|
|
|
TRACE_1("Ending PFEH", GVAR(pfeh_id));
|
2015-06-09 01:34:29 +00:00
|
|
|
[GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler;
|
|
|
|
GVAR(pfeh_id) = -1;
|
|
|
|
};
|