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

@ -17,6 +17,12 @@ class ACE_Settings {
displayName = CSTRING(BFT_HideAiGroups_DisplayName); displayName = CSTRING(BFT_HideAiGroups_DisplayName);
description = CSTRING(BFT_HideAiGroups_Description); description = CSTRING(BFT_HideAiGroups_Description);
}; };
class GVAR(BFT_ShowPlayerNames) {
value = 0;
typeName = "BOOL";
displayName = CSTRING(BFT_ShowPlayerNames_DisplayName);
description = CSTRING(BFT_ShowPlayerNames_Description);
};
class GVAR(mapIllumination) { class GVAR(mapIllumination) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";

View File

@ -104,9 +104,15 @@ class CfgVehicles {
typeName = "BOOL"; typeName = "BOOL";
defaultValue = 0; defaultValue = 0;
}; };
class ShowPlayerNames {
displayName = CSTRING(BFT_ShowPlayerNames_DisplayName);
description = CSTRING(BFT_ShowPlayerNames_Description);
typeName = "BOOL";
defaultValue = 0;
};
}; };
class ModuleDescription { class ModuleDescription {
description = CSTRING(BFT_Module_Description); description = CSTRING(BFT_Module_Description);
}; };
}; };
}; };

View File

@ -18,5 +18,6 @@ params ["_logic"];
[_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(BFT_Interval), "Interval"] 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_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)); 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" #include "script_component.hpp"
// BEGIN_COUNTER(blueForceTrackingUpdate); // BEGIN_COUNTER(blueForceTrackingUpdate);
private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"]; private ["_groupsToDrawMarkers", "_playersToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"];
// Delete last set of markers (always) // 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); _playerSide = call EFUNC(common,playerSide);
_groupsToDrawMarkers = allGroups select {side _x == _playerSide}; _groupsToDrawMarkers = allGroups select {side _x == _playerSide};
_playersToDrawMarkers = allPlayers select {side _x == _playerSide};
if (GVAR(BFT_HideAiGroups)) then { if (GVAR(BFT_HideAiGroups)) then {
_groupsToDrawMarkers = _groupsToDrawMarkers select { _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 _markerType = [_x] call EFUNC(common,getMarkerType);
private _colour = format ["Color%1", side _x]; 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]]; private _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]];
_marker setMarkerTypeLocal _markerType; _marker setMarkerTypeLocal _markerType;
_marker setMarkerColorLocal _colour; _marker setMarkerColorLocal _colour;
_marker setMarkerTextLocal (groupID _x); _marker setMarkerTextLocal (groupId _x);
GVAR(BFT_markers) pushBack _marker; GVAR(BFT_markers) pushBack _marker;
} forEach _groupsToDrawMarkers; } forEach _groupsToDrawMarkers;

View File

@ -225,6 +225,30 @@
<Russian>Скрыть маркеры групп, которые состоят полностью из ботов?</Russian> <Russian>Скрыть маркеры групп, которые состоят полностью из ботов?</Russian>
<Italian>Nascondi markers per gruppi di sole IA?</Italian> <Italian>Nascondi markers per gruppi di sole IA?</Italian>
</Key> </Key>
<Key ID="STR_ACE_Map_BFT_ShowPlayerNames_DisplayName">
<English>Show player names?</English>
<Polish>Pokaż imiona graczy?</Polish>
<Spanish>Mostrar nombres de los jugadores?</Spanish>
<German>Zeigen Sie die Namen der Spieler?</German>
<Czech>Zobrazit jména hráčů?</Czech>
<Portuguese>Mostrar os nomes dos jogadores?</Portuguese>
<French>Afficher les noms des joueurs?</French>
<Hungarian>Itt található az a játékos nevét?</Hungarian>
<Russian>Показать имена игроков?</Russian>
<Italian>Mostra i nomi dei giocatori?</Italian>
</Key>
<Key ID="STR_ACE_Map_BFT_ShowPlayerNames_Description">
<English>Show individual player names?</English>
<Polish>Pokaż poszczególne imiona graczy?</Polish>
<Spanish>Mostrar nombres de los jugadores individuales?</Spanish>
<German>Zeigen einzelnen Spielernamen?</German>
<Czech>Zobrazit názvy jednotlivých hráčů?</Czech>
<Portuguese>Mostrar nomes individuais dos jogadores?</Portuguese>
<French>Afficher les noms des joueurs individuels?</French>
<Hungarian>Itt található az adott játékos neveket?</Hungarian>
<Russian>Показать отдельные имена игроков?</Russian>
<Italian>Mostra i nomi dei giocatori singoli?</Italian>
</Key>
<Key ID="STR_ACE_Map_BFT_Module_Description"> <Key ID="STR_ACE_Map_BFT_Module_Description">
<English>This module allows the tracking of allied units with BFT map markers.</English> <English>This module allows the tracking of allied units with BFT map markers.</English>
<Polish>Pozwala śledzić na mapie pozycje sojuszniczych jednostek za pomocą markerów BFT.</Polish> <Polish>Pozwala śledzić na mapie pozycje sojuszniczych jednostek za pomocą markerów BFT.</Polish>