ACE3/addons/map/functions/fnc_blueForceTrackingUpdate.sqf
freghar 9fa247398f add BlueForceTracking filtering via an object variable (#4196)
There's no good workaround for this:

 * creating a dummy unit on [0,0,0] and making it leader prevents
   grp members from entering vehicles
 * joining group of a different side prevents grp members from seeing
   blueforce tracking markers of their original side

Usage (_obj can be group or unit, depending on BFT_ShowPlayerNames):

  _obj setVariable ["ACE_map_hideBlueForceMarker", true];

The inverse, hiding of markers of other groups/units for a particular
player, can be already done by 'ace_map_BFT_Enabled = false' locally,
as the Update function checks for it every time.

Signed-off-by: freghar <freghcz@gmail.com>
2016-08-16 19:28:21 -05:00

67 lines
2.3 KiB
Plaintext

// #define ENABLE_PERFORMANCE_COUNTERS
#include "script_component.hpp"
// BEGIN_COUNTER(blueForceTrackingUpdate);
private ["_groupsToDrawMarkers", "_playersToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
// Delete last set of markers (always)
{
deleteMarkerLocal _x;
} forEach GVAR(BFT_markers);
GVAR(BFT_markers) = [];
if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
_groupsToDrawMarkers = [];
_playerSide = call EFUNC(common,playerSide);
_groupsToDrawMarkers = allGroups select {side _x == _playerSide};
if (GVAR(BFT_HideAiGroups)) then {
_groupsToDrawMarkers = _groupsToDrawMarkers select {
{
_x call EFUNC(common,isPlayer);
} count units _x > 0;
};
};
if (GVAR(BFT_ShowPlayerNames)) then {
_playersToDrawMarkers = allPlayers select {side _x == _playerSide && {!(_x getVariable [QGVAR(hideBlueForceMarker), false])}};
{
private _markerType = [_x] call EFUNC(common,getMarkerType);
private _colour = format ["Color%1", side _x];
private _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos _x) select 0, (getPos _x) select 1]];
_marker setMarkerTypeLocal _markerType;
_marker setMarkerColorLocal _colour;
_marker setMarkerTextLocal (name _x);
GVAR(BFT_markers) pushBack _marker;
} forEach _playersToDrawMarkers;
_groupsToDrawMarkers = _groupsToDrawMarkers select {
{
!(_x call EFUNC(common,isPlayer));
} count units _x > 0;
};
};
_groupsToDrawMarkers = _groupsToDrawMarkers select {!(_x getVariable [QGVAR(hideBlueForceMarker), false])};
{
private _markerType = [_x] call EFUNC(common,getMarkerType);
private _colour = format ["Color%1", side _x];
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);
GVAR(BFT_markers) pushBack _marker;
} forEach _groupsToDrawMarkers;
};
// END_COUNTER(blueForceTrackingUpdate);