2015-08-08 06:26:15 +00:00
|
|
|
/*
|
2015-08-10 06:45:43 +00:00
|
|
|
* Author: Dslyecxi, MikeMatrix
|
2015-08-08 06:26:15 +00:00
|
|
|
* Receives and draws map gestures from nearby players.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Map Handle <CONTROL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [findDisplay 12 displayCtrl 51] call ace_map_gesutres_fnc_drawMapGestures
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-24 15:03:47 +00:00
|
|
|
#define ICON_RENDER_SIZE 55
|
|
|
|
#define ICON_TEXT_ALIGN "left"
|
|
|
|
#define ICON_ANGLE 0
|
|
|
|
#define ICON_SHADOW 1
|
|
|
|
#define TEXT_FONT "PuristaBold"
|
|
|
|
#define TEXT_ICON_RENDER_SIZE 20
|
|
|
|
#define TEXT_SIZE 0.030
|
|
|
|
#define TEXT_SHADOW 0
|
|
|
|
|
|
|
|
if (!GVAR(enabled) || !visibleMap) exitWith {};
|
2015-08-08 06:26:15 +00:00
|
|
|
|
2015-08-24 21:26:03 +00:00
|
|
|
private["_color", "_drawPosVariableName", "_group", "_grpName", "_pos", "_unitUID"];
|
|
|
|
|
2015-08-08 06:26:15 +00:00
|
|
|
params ["_mapHandle"];
|
|
|
|
|
2015-08-24 15:03:47 +00:00
|
|
|
// Iterate over all nearby players and render their pointer if player is transmitting.
|
2015-08-08 06:26:15 +00:00
|
|
|
{
|
2015-08-24 15:03:47 +00:00
|
|
|
// Data variable name for unit
|
|
|
|
_unitUID = getPlayerUID _x;
|
|
|
|
_drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil};
|
|
|
|
|
|
|
|
if (!isNil "_drawPosVariableName") then {
|
2015-08-15 10:12:41 +00:00
|
|
|
if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];};
|
|
|
|
_pos = missionNamespace getVariable _drawPosVariableName;
|
2015-08-24 15:03:47 +00:00
|
|
|
|
|
|
|
// Only render if the unit is alive and transmitting
|
|
|
|
if (alive _x && {_x getVariable QGVAR(Transmit)}) then {
|
2015-08-08 06:26:15 +00:00
|
|
|
_group = group _x;
|
|
|
|
_grpName = groupID _group;
|
|
|
|
|
2015-08-24 15:03:47 +00:00
|
|
|
// If color settings for the group exist, then use those, otherwise fall back to the default colors
|
2015-08-24 20:45:59 +00:00
|
|
|
_color = if (HASH_HASKEY(GVAR(GroupColorConfigurationMapping),_grpName)) then {
|
|
|
|
(GVAR(GroupColorConfigurations) select (HASH_GET(GVAR(GroupColorConfigurationMapping),_grpName))) select (_x != leader _group)
|
2015-08-08 06:26:15 +00:00
|
|
|
} else {
|
2015-08-10 13:24:57 +00:00
|
|
|
if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
|
2015-08-08 06:26:15 +00:00
|
|
|
};
|
|
|
|
|
2015-08-24 15:03:47 +00:00
|
|
|
// Render icon and player name
|
|
|
|
_mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
|
2015-08-24 20:03:47 +00:00
|
|
|
_mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", GVAR(nameTextColor), _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
|
2015-08-08 06:26:15 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
nil
|
2015-08-24 15:03:47 +00:00
|
|
|
} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers));
|