ACE3/addons/map/functions/fnc_blueForceTrackingUpdate.sqf

44 lines
1.4 KiB
Plaintext
Raw Normal View History

// #define ENABLE_PERFORMANCE_COUNTERS
2015-01-16 08:13:29 +00:00
#include "script_component.hpp"
// BEGIN_COUNTER(blueForceTrackingUpdate);
2015-01-16 08:13:29 +00:00
2015-10-14 17:56:54 +00:00
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
2015-04-18 03:40:37 +00:00
2015-01-16 08:13:29 +00:00
// Delete last set of markers (always)
{
deleteMarkerLocal _x;
2015-01-16 08:13:29 +00:00
} forEach GVAR(BFT_markers);
GVAR(BFT_markers) = [];
2015-01-16 08:13:29 +00:00
if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
_groupsToDrawMarkers = [];
_playerSide = call EFUNC(common,playerSide);
2015-01-16 08:13:29 +00:00
if !(GVAR(BFT_HideAiGroups)) then {
2016-02-06 10:58:31 +00:00
_groupsToDrawMarkers = allGroups select {side _x == _playerSide};
} else {
2016-02-06 10:58:31 +00:00
_groupsToDrawMarkers = allGroups select {
_anyPlayers = {
[_x] call EFUNC(common,isPlayer);
2016-02-06 10:58:31 +00:00
} count units _x;
(side _x == _playerSide) && _anyPlayers > 0
}; // @todo, simplify this
};
2015-01-16 08:13:29 +00:00
{
2015-11-23 23:47:58 +00:00
private _markerType = [_x] call EFUNC(common,getMarkerType);
private _colour = format ["Color%1", side _x];
2015-01-16 08:13:29 +00:00
2015-11-23 23:47:58 +00:00
private _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
_marker setMarkerTypeLocal _markerType;
_marker setMarkerColorLocal _colour;
_marker setMarkerTextLocal (groupID _x);
2015-01-16 08:13:29 +00:00
GVAR(BFT_markers) pushBack _marker;
} forEach _groupsToDrawMarkers;
2015-01-16 08:13:29 +00:00
};
// END_COUNTER(blueForceTrackingUpdate);