Name tags Draw3D variable names consistency

This commit is contained in:
jonpas 2015-05-16 01:35:48 +02:00
parent bffe58efd6
commit c0c4414ec0

View File

@ -21,7 +21,7 @@ private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon",
if (!alive ACE_player) exitWith {};
_onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then {
2 + (GVAR(ShowNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0
2 + (GVAR(showNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0
} else {
1
};
@ -41,10 +41,10 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then {
if ((!isNull _target) &&
{(side (group _target)) == (side (group ACE_player))} &&
{_target != ACE_player} &&
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{!(_target getVariable ["ACE_hideName", false])}) then {
_distance = ACE_player distance _target;
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha);
_alpha = ((1 - 0.2 * (_distance - GVAR(playerNamesViewDistance))) min 1) * GVAR(playerNamesMaxAlpha);
_alpha = _alpha min _onKeyPressAlphaMax;
[ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon);
};
@ -58,10 +58,10 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then {
{_target isKindOf "CAManBase"} &&
{(side (group _target)) == (side (group ACE_player))} &&
{_target != ACE_player} &&
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{!(_target getVariable ["ACE_hideName", false])}) then {
_distance = ACE_player distance _target;
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha);
_alpha = ((1 - 0.2 * (_distance - GVAR(playerNamesViewDistance))) min 1) * GVAR(playerNamesMaxAlpha);
_alpha = _alpha min _onKeyPressAlphaMax;
_icon = ICON_NONE;
if (GVAR(showSoundWaves) == 2) then { //icon will be drawn below, so only show name here
@ -76,7 +76,7 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then {
if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(showSoundWaves) == 2}) then {
_pos = positionCameraToWorld [0, 0, 0];
_targets = _pos nearObjects ["CAManBase", GVAR(PlayerNamesViewDistance) + 5];
_targets = _pos nearObjects ["CAManBase", GVAR(playerNamesViewDistance) + 5];
if (!surfaceIsWater _pos) then {
_pos = ATLtoASL _pos;
@ -101,7 +101,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
if ((_icon != ICON_NONE) &&
{(side (group _target)) == (side (group ACE_player))} &&
{_target != ACE_player} &&
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{!(_target getVariable ["ACE_hideName", false])}) then {
if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle ACE_player, _target]) exitWith {}; // Check if there is line of sight
@ -109,7 +109,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
_distance = vectorMagnitude _relPos;
_projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy));
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha);
_alpha = ((1 - 0.2 * (_distance - GVAR(playerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(playerNamesMaxAlpha);
if ((GVAR(showSoundWaves) == 2) && {([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}}) then {
_alpha = 1;