different colors for different factions, show AI

This commit is contained in:
Magnus von Wachenfeldt 2017-12-08 21:21:08 +01:00
parent b9ac6c2b82
commit 3e0e6ca164

View File

@ -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 boxHeight = Math.Abs(Camera.main.WorldToScreenPoint(player.PlayerBones.Head.position).y - Camera.main.WorldToScreenPoint(player.Transform.position).y) + 10f;
float boxWidth = boxHeight * 0.65f; float boxWidth = boxHeight * 0.65f;
var isBot = player.Profile.Info.Nickname.Contains(" "); var playerColor = GetPlayerColor(player.Side);
var playerColor = isBot ? Color.cyan : Color.red; var isAi = player.Profile.Info.RegistrationDate <= 0;
var espColor = player.Profile.Health.IsAlive ? playerColor : Color.white; var espColor = player.Profile.Health.IsAlive ? playerColor : Color.gray;
GUI.color = espColor; GUI.color = espColor;
GuiHelper.DrawBox(boxXOffset - boxWidth / 2f, (float)Screen.height - boxYOffset, boxWidth, boxHeight, 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 - 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); 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; float playerHealth = player.HealthController.SummaryHealth.CurrentValue / 435f * 100f;
string playerDisplayName = player.Profile.Health.IsAlive ? playerName : playerName + " (DEAD)"; string playerDisplayName = player.Profile.Health.IsAlive ? playerName : playerName + " (DEAD)";
string playerText = $"[{(int)playerHealth}%] {playerDisplayName} [{(int)distanceToObject}m]"; 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() private void DrawESPMenu()
{ {
GUI.color = Color.black; GUI.color = Color.black;