different colors for different factions, show AI
This commit is contained in:
parent
b9ac6c2b82
commit
3e0e6ca164
@ -210,16 +210,16 @@ namespace TarkovHax
|
||||
float boxHeight = Math.Abs(Camera.main.WorldToScreenPoint(player.PlayerBones.Head.position).y - Camera.main.WorldToScreenPoint(player.Transform.position).y) + 10f;
|
||||
float boxWidth = boxHeight * 0.65f;
|
||||
|
||||
var isBot = player.Profile.Info.Nickname.Contains(" ");
|
||||
var playerColor = isBot ? Color.cyan : Color.red;
|
||||
var espColor = player.Profile.Health.IsAlive ? playerColor : Color.white;
|
||||
var playerColor = GetPlayerColor(player.Side);
|
||||
var isAi = player.Profile.Info.RegistrationDate <= 0;
|
||||
var espColor = player.Profile.Health.IsAlive ? playerColor : Color.gray;
|
||||
|
||||
GUI.color = espColor;
|
||||
GuiHelper.DrawBox(boxXOffset - boxWidth / 2f, (float)Screen.height - boxYOffset, boxWidth, boxHeight, espColor);
|
||||
GuiHelper.DrawLine(new Vector2(playerHeadVector.x - 2f, (float)Screen.height - playerHeadVector.y), new Vector2(playerHeadVector.x + 2f, (float)Screen.height - playerHeadVector.y), espColor);
|
||||
GuiHelper.DrawLine(new Vector2(playerHeadVector.x, (float)Screen.height - playerHeadVector.y - 2f), new Vector2(playerHeadVector.x, (float)Screen.height - playerHeadVector.y + 2f), espColor);
|
||||
|
||||
var playerName = isBot ? "SCAV" : player.Profile.Info.Nickname;
|
||||
var playerName = isAi ? "AI" : player.Profile.Info.Nickname;
|
||||
float playerHealth = player.HealthController.SummaryHealth.CurrentValue / 435f * 100f;
|
||||
string playerDisplayName = player.Profile.Health.IsAlive ? playerName : playerName + " (DEAD)";
|
||||
string playerText = $"[{(int)playerHealth}%] {playerDisplayName} [{(int)distanceToObject}m]";
|
||||
@ -230,6 +230,21 @@ namespace TarkovHax
|
||||
}
|
||||
}
|
||||
|
||||
private Color GetPlayerColor(EPlayerSide side)
|
||||
{
|
||||
switch (side)
|
||||
{
|
||||
case EPlayerSide.Bear:
|
||||
return Color.red;
|
||||
case EPlayerSide.Usec:
|
||||
return Color.blue;
|
||||
case EPlayerSide.Savage:
|
||||
return Color.white;
|
||||
default:
|
||||
return Color.white;
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawESPMenu()
|
||||
{
|
||||
GUI.color = Color.black;
|
||||
|
Loading…
Reference in New Issue
Block a user