2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-06-08 13:31:51 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE-Team
|
|
|
|
* Update the blue force tracking.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ACE_map_fnc_blueForceTrackingUpdate
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-05-17 02:54:11 +00:00
|
|
|
// BEGIN_COUNTER(blueForceTrackingUpdate);
|
2015-01-16 08:13:29 +00:00
|
|
|
|
|
|
|
// Delete last set of markers (always)
|
|
|
|
{
|
2015-03-14 19:58:05 +00:00
|
|
|
deleteMarkerLocal _x;
|
2015-01-16 08:13:29 +00:00
|
|
|
} forEach GVAR(BFT_markers);
|
|
|
|
|
2015-05-17 02:54:11 +00:00
|
|
|
GVAR(BFT_markers) = [];
|
2015-01-16 08:13:29 +00:00
|
|
|
|
|
|
|
if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
|
|
|
|
|
2016-06-18 00:18:06 +00:00
|
|
|
private _groupsToDrawMarkers = [];
|
|
|
|
private _playerSide = call EFUNC(common,playerSide);
|
2015-01-16 08:13:29 +00:00
|
|
|
|
2016-02-06 13:59:31 +00:00
|
|
|
_groupsToDrawMarkers = allGroups select {side _x == _playerSide};
|
|
|
|
|
|
|
|
if (GVAR(BFT_HideAiGroups)) then {
|
|
|
|
_groupsToDrawMarkers = _groupsToDrawMarkers select {
|
|
|
|
{
|
|
|
|
_x call EFUNC(common,isPlayer);
|
|
|
|
} count units _x > 0;
|
|
|
|
};
|
2015-03-14 19:58:05 +00:00
|
|
|
};
|
2015-01-16 08:13:29 +00:00
|
|
|
|
2016-02-25 13:57:32 +00:00
|
|
|
if (GVAR(BFT_ShowPlayerNames)) then {
|
2016-08-25 20:50:11 +00:00
|
|
|
private _playersToDrawMarkers = allPlayers select {side _x == _playerSide && {!(_x getVariable [QGVAR(hideBlueForceMarker), false])}};
|
2016-02-25 14:35:33 +00:00
|
|
|
|
2016-02-25 13:57:32 +00:00
|
|
|
{
|
|
|
|
private _markerType = [_x] call EFUNC(common,getMarkerType);
|
|
|
|
private _colour = format ["Color%1", side _x];
|
|
|
|
|
2020-04-30 16:40:18 +00:00
|
|
|
private _marker = createMarkerLocal [format ["ACE_BFT_player_%1", _forEachIndex], [(getPos _x) select 0, (getPos _x) select 1]];
|
2016-02-25 13:57:32 +00:00
|
|
|
_marker setMarkerTypeLocal _markerType;
|
|
|
|
_marker setMarkerColorLocal _colour;
|
|
|
|
_marker setMarkerTextLocal (name _x);
|
|
|
|
|
|
|
|
GVAR(BFT_markers) pushBack _marker;
|
|
|
|
} forEach _playersToDrawMarkers;
|
|
|
|
|
2016-02-25 15:03:30 +00:00
|
|
|
_groupsToDrawMarkers = _groupsToDrawMarkers select {
|
|
|
|
{
|
|
|
|
!(_x call EFUNC(common,isPlayer));
|
|
|
|
} count units _x > 0;
|
2016-02-25 13:57:32 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-08-17 00:28:21 +00:00
|
|
|
_groupsToDrawMarkers = _groupsToDrawMarkers select {!(_x getVariable [QGVAR(hideBlueForceMarker), false])};
|
|
|
|
|
2015-03-14 19:58:05 +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
|
|
|
|
2020-04-30 16:40:18 +00:00
|
|
|
private _marker = createMarkerLocal [format ["ACE_BFT_group_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
|
2015-03-14 19:58:05 +00:00
|
|
|
_marker setMarkerTypeLocal _markerType;
|
|
|
|
_marker setMarkerColorLocal _colour;
|
2016-02-25 13:57:32 +00:00
|
|
|
_marker setMarkerTextLocal (groupId _x);
|
2015-01-16 08:13:29 +00:00
|
|
|
|
2015-03-14 19:58:05 +00:00
|
|
|
GVAR(BFT_markers) pushBack _marker;
|
|
|
|
} forEach _groupsToDrawMarkers;
|
2015-01-16 08:13:29 +00:00
|
|
|
};
|
2015-05-17 02:54:11 +00:00
|
|
|
|
|
|
|
// END_COUNTER(blueForceTrackingUpdate);
|