Added Show Player Names option to Blue Force Tracking Module

This commit is contained in:
looterz
2016-02-25 07:57:32 -06:00
parent 804456c722
commit 00f06f81d1
5 changed files with 61 additions and 3 deletions

View File

@ -18,5 +18,6 @@ params ["_logic"];
[_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_ShowPlayerNames), "ShowPlayerNames"] call EFUNC(common,readSettingFromModule);
ACE_LOGINFO_3("Blue Force Tracking Module Initialized:", GVAR(BFT_Enabled), GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));

View File

@ -2,7 +2,7 @@
#include "script_component.hpp"
// BEGIN_COUNTER(blueForceTrackingUpdate);
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
private ["_groupsToDrawMarkers", "_playersToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
// Delete last set of markers (always)
{
@ -17,6 +17,7 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
_playerSide = call EFUNC(common,playerSide);
_groupsToDrawMarkers = allGroups select {side _x == _playerSide};
_playersToDrawMarkers = allPlayers select {side _x == _playerSide};
if (GVAR(BFT_HideAiGroups)) then {
_groupsToDrawMarkers = _groupsToDrawMarkers select {
@ -26,6 +27,26 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
};
};
if (GVAR(BFT_ShowPlayerNames)) then {
{
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 (name _x);
GVAR(BFT_markers) pushBack _marker;
} forEach _playersToDrawMarkers;
_groupsToDrawMarkers = _groupsToDrawMarkers select {
{
!(_x call EFUNC(common,isPlayer));
} count units _x > 0;
};
};
{
private _markerType = [_x] call EFUNC(common,getMarkerType);
private _colour = format ["Color%1", side _x];
@ -33,7 +54,7 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then {
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);
_marker setMarkerTextLocal (groupId _x);
GVAR(BFT_markers) pushBack _marker;
} forEach _groupsToDrawMarkers;