mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Name tags Draw3D variable names consistency
This commit is contained in:
parent
bffe58efd6
commit
c0c4414ec0
@ -21,7 +21,7 @@ private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon",
|
|||||||
if (!alive ACE_player) exitWith {};
|
if (!alive ACE_player) exitWith {};
|
||||||
|
|
||||||
_onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then {
|
_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 {
|
} else {
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
@ -41,10 +41,10 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then {
|
|||||||
if ((!isNull _target) &&
|
if ((!isNull _target) &&
|
||||||
{(side (group _target)) == (side (group ACE_player))} &&
|
{(side (group _target)) == (side (group ACE_player))} &&
|
||||||
{_target != 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 {
|
{!(_target getVariable ["ACE_hideName", false])}) then {
|
||||||
_distance = ACE_player distance _target;
|
_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;
|
_alpha = _alpha min _onKeyPressAlphaMax;
|
||||||
[ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon);
|
[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"} &&
|
{_target isKindOf "CAManBase"} &&
|
||||||
{(side (group _target)) == (side (group ACE_player))} &&
|
{(side (group _target)) == (side (group ACE_player))} &&
|
||||||
{_target != 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 {
|
{!(_target getVariable ["ACE_hideName", false])}) then {
|
||||||
_distance = ACE_player distance _target;
|
_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;
|
_alpha = _alpha min _onKeyPressAlphaMax;
|
||||||
_icon = ICON_NONE;
|
_icon = ICON_NONE;
|
||||||
if (GVAR(showSoundWaves) == 2) then { //icon will be drawn below, so only show name here
|
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 {
|
if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(showSoundWaves) == 2}) then {
|
||||||
_pos = positionCameraToWorld [0, 0, 0];
|
_pos = positionCameraToWorld [0, 0, 0];
|
||||||
_targets = _pos nearObjects ["CAManBase", GVAR(PlayerNamesViewDistance) + 5];
|
_targets = _pos nearObjects ["CAManBase", GVAR(playerNamesViewDistance) + 5];
|
||||||
|
|
||||||
if (!surfaceIsWater _pos) then {
|
if (!surfaceIsWater _pos) then {
|
||||||
_pos = ATLtoASL _pos;
|
_pos = ATLtoASL _pos;
|
||||||
@ -101,7 +101,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
|
|||||||
if ((_icon != ICON_NONE) &&
|
if ((_icon != ICON_NONE) &&
|
||||||
{(side (group _target)) == (side (group ACE_player))} &&
|
{(side (group _target)) == (side (group ACE_player))} &&
|
||||||
{_target != 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 {
|
{!(_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
|
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;
|
_distance = vectorMagnitude _relPos;
|
||||||
_projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy));
|
_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 {
|
if ((GVAR(showSoundWaves) == 2) && {([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}}) then {
|
||||||
_alpha = 1;
|
_alpha = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user