2015-07-25 11:28:03 +00:00
|
|
|
/*
|
2015-08-06 12:42:31 +00:00
|
|
|
* Author: Head, SilentSpike
|
2015-07-25 11:28:03 +00:00
|
|
|
* Handles rendering the spectator 3D unit icons
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Parameters <ANY>
|
|
|
|
* 1: PFH handle <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None <NIL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if !(GVAR(showIcons)) exitWith {};
|
2015-08-06 12:42:31 +00:00
|
|
|
private ["_refPoint","_drawVehicles","_leader","_color","_txt","_unit"];
|
2015-07-25 11:28:03 +00:00
|
|
|
|
2015-08-06 12:42:31 +00:00
|
|
|
// Draw groups unless leader is within distance
|
2015-09-09 22:21:49 +00:00
|
|
|
_refPoint = [GVAR(freeCamera),GVAR(camUnit)] select (GVAR(camMode) > 0);
|
2015-08-06 12:42:31 +00:00
|
|
|
_drawVehicles = [];
|
2015-07-25 11:28:03 +00:00
|
|
|
{
|
2015-08-06 12:42:31 +00:00
|
|
|
_leader = leader _x;
|
|
|
|
if ((_leader distanceSqr _refPoint) > 40000) then {
|
|
|
|
_color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]);
|
|
|
|
_txt = groupID _x;
|
|
|
|
|
2017-06-03 00:56:24 +00:00
|
|
|
drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, (_leader modelToWorldVisual (_leader selectionPosition "Head")) vectorAdd [0,0,28.5], 1, 1, 0, _txt, 2, 0.02];
|
2015-08-06 12:42:31 +00:00
|
|
|
} else {
|
|
|
|
_drawVehicles append (units _x);
|
|
|
|
};
|
|
|
|
false
|
|
|
|
} count GVAR(groupList);
|
2015-07-25 11:28:03 +00:00
|
|
|
|
2015-08-06 12:42:31 +00:00
|
|
|
// Draw units for groups within distance
|
|
|
|
{
|
|
|
|
_color = GETVAR((group _x),GVAR(gColor),[ARR_4(0,0,0,0)]);
|
|
|
|
_txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x);
|
2015-07-25 11:28:03 +00:00
|
|
|
|
2017-06-03 00:38:29 +00:00
|
|
|
drawIcon3D ["a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\UnitIcon_ca.paa", _color, (_x modelToWorldVisual (_x selectionPosition "Head")) vectorAdd [0,0,1.5], 0.7, 0.7, 0, _txt, 1, 0.02];
|
2015-08-06 12:42:31 +00:00
|
|
|
false
|
|
|
|
} count (_drawVehicles arrayIntersect GVAR(unitList));
|