Merge pull request #2882 from acemod/fixUGVNametag

fix UGV Nametag issue
This commit is contained in:
Thomas Kooi 2015-11-28 20:50:23 +01:00
commit d7a19cf0a6

View File

@ -30,7 +30,7 @@ private ["_position", "_color", "_name", "_size", "_icon", "_scale"];
_icon = "";
_size = 0;
if (_iconType in [ICON_NAME_SPEAK, ICON_SPEAK]) then {
_icon = QUOTE(PATHTOF(UI\soundwave)) + str (floor (random 10)) + ".paa";
_icon = format ["%1%2%3",QUOTE(PATHTOF(UI\soundwave)), floor (random 10), ".paa"];
_size = 1;
_alpha = (_alpha max 0.2) + 0.2;//Boost alpha when speaking
} else {
@ -57,20 +57,24 @@ if ((group _target) != (group _player)) then {
_color = [[1, 1, 1, _alpha], [1, 0, 0, _alpha], [0, 1, 0, _alpha], [0, 0, 1, _alpha], [1, 1, 0, _alpha]] select ((["MAIN", "RED", "GREEN", "BLUE", "YELLOW"] find (assignedTeam _target)) max 0);
};
if (isNil "_color") then {
_color = [1, 1, 1, _alpha];
};
// Convert position to ASLW (expected by drawIcon3D) and add height offsets
_position = _target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .3)]);
_scale = [0.333, 0.5, 0.666, 0.83333, 1] select GVAR(tagSize);
drawIcon3D [
_icon,
_color,
_position,
(_size * _scale),
(_size * _scale),
0,
_name,
2,
(0.05 * _scale),
"PuristaMedium"
_icon,
_color,
_position,
(_size * _scale),
(_size * _scale),
0,
_name,
2,
(0.05 * _scale),
"PuristaMedium"
];