the initial commit to the repo.
This commit is contained in:
parent
025c032b8c
commit
1b757591b9
264 changed files with 21882 additions and 0 deletions
243
stoopid.raw/stupid.solutions.Features.ESP/CorpseEsp.cs
Normal file
243
stoopid.raw/stupid.solutions.Features.ESP/CorpseEsp.cs
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EFT.Interactive;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
internal class CorpseEsp : MonoBehaviour
|
||||
{
|
||||
private Texture2D stex;
|
||||
|
||||
public static List<GameCorpse> Corpses = new List<GameCorpse>();
|
||||
|
||||
private float _nextBodyCacheTime;
|
||||
|
||||
private static readonly float CacheLootItemsInterval = 10f;
|
||||
|
||||
private int initialYOffset = Settings.initialYOffset;
|
||||
|
||||
private Dictionary<string, int?> lootItemPrices = new Dictionary<string, int?>();
|
||||
|
||||
private static readonly float ItemListCacheInterval = 30f;
|
||||
|
||||
private float _nextItemListCache;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
stex = new Texture2D(1, 1);
|
||||
stex.SetPixel(0, 0, Color.blue);
|
||||
stex.Apply();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!Settings.BodyESP)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Time.time >= _nextBodyCacheTime && Main.GameWorld != null && Main.GameWorld.ObservedPlayersCorpses != null)
|
||||
{
|
||||
Corpses.Clear();
|
||||
Corpse[] array = Object.FindObjectsOfType<Corpse>();
|
||||
foreach (Corpse corpse in array)
|
||||
{
|
||||
if (GameUtils.IsCorpseValid(corpse) && !(Vector3.Distance(Main.MainCamera.transform.position, corpse.transform.position) > Settings.DrawLootableContainersDistance))
|
||||
{
|
||||
Corpses.Add(new GameCorpse(corpse));
|
||||
}
|
||||
}
|
||||
_nextBodyCacheTime = Time.time + CacheLootItemsInterval;
|
||||
}
|
||||
foreach (GameCorpse corpse2 in Corpses)
|
||||
{
|
||||
corpse2.RecalculateDynamics();
|
||||
if (!(Time.time >= _nextItemListCache) || corpse2.Corpse.ItemOwner.RootItem.GetAllItems().Count() < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num = 1;
|
||||
foreach (ContainerItem lootItem in corpse2.LootItems)
|
||||
{
|
||||
num += lootItem.Count * lootItem.Item.StackObjectsCount;
|
||||
}
|
||||
if (corpse2.Corpse.ItemOwner.RootItem.GetAllItems().Count() != num)
|
||||
{
|
||||
corpse2.RefreshItems();
|
||||
}
|
||||
_nextItemListCache = Time.time + ItemListCacheInterval;
|
||||
}
|
||||
if (Settings.playerWeapon)
|
||||
{
|
||||
initialYOffset = Settings.initialYOffset - 20;
|
||||
}
|
||||
if (!Input.GetKeyDown(KeyCode.Delete) || Settings.allinputdisabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GameCorpse corpse3 in Corpses)
|
||||
{
|
||||
corpse3.RecalculateDynamics();
|
||||
corpse3.RefreshItems();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!Settings.BodyESP || Main.MainCamera == null || Main.GameWorld == null || Main.LocalPlayer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int xOffset = Settings.xOffset;
|
||||
int num = Settings.initialYOffset;
|
||||
int itemLineHeight = Settings.itemLineHeight;
|
||||
int lineWidth = Settings.lineWidth;
|
||||
int lineX = Settings.lineX;
|
||||
GUIStyle style = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
alignment = TextAnchor.UpperLeft,
|
||||
fontSize = 12,
|
||||
font = Main.TXTFONT,
|
||||
normal = new GUIStyleState
|
||||
{
|
||||
textColor = Color.cyan
|
||||
}
|
||||
};
|
||||
GUIStyle gUIStyle = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
alignment = TextAnchor.UpperLeft,
|
||||
fontSize = 12,
|
||||
font = Main.TXTFONT
|
||||
};
|
||||
foreach (GameCorpse corpse in Corpses)
|
||||
{
|
||||
if (!corpse.IsOnScreen || corpse.Distance > Settings.DrawLootableContainersDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Vector2 vector = new Vector2(corpse.ScreenPosition.x, corpse.ScreenPosition.y);
|
||||
if (!corpse.ItemInit)
|
||||
{
|
||||
corpse.RefreshItems();
|
||||
}
|
||||
if (corpse.LootItems.Count <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Vector3 position = corpse.Corpse.transform.position;
|
||||
bool flag = Aimbot.CaulculateInFov2(new Vector3(position.x, position.y, position.z)) <= Settings.SimpleStringsFOV;
|
||||
if (Settings.DrawSimpleStrings)
|
||||
{
|
||||
string text = "";
|
||||
string text2 = "";
|
||||
string text3 = "";
|
||||
foreach (ContainerItem lootItem in corpse.LootItems)
|
||||
{
|
||||
if (GameUtils.ShouldDisplayItem(lootItem))
|
||||
{
|
||||
switch (lootItem.Itemcat)
|
||||
{
|
||||
case ItemCategories.Kappa:
|
||||
{
|
||||
string text11 = ColorUtility.ToHtmlStringRGB(Settings.KappaColor);
|
||||
text2 = text2 + "<color=#" + text11 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Superrare:
|
||||
{
|
||||
string text10 = ColorUtility.ToHtmlStringRGB(Settings.SuperrareColor);
|
||||
text2 = text2 + "<color=#" + text10 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Stim:
|
||||
{
|
||||
string text9 = ColorUtility.ToHtmlStringRGB(Settings.StimItemColor);
|
||||
text2 = text2 + "<color=#" + text9 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Quest:
|
||||
{
|
||||
string text8 = ColorUtility.ToHtmlStringRGB(Settings.QuestItemColor);
|
||||
text2 = text2 + "<color=#" + text8 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Wishlist:
|
||||
{
|
||||
string text7 = ColorUtility.ToHtmlStringRGB(Settings.WishlistColor);
|
||||
text2 = text2 + "<color=#" + text7 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Hideout:
|
||||
{
|
||||
string text6 = ColorUtility.ToHtmlStringRGB(Settings.HideoutColor);
|
||||
text2 = text2 + "<color=#" + text6 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Searched:
|
||||
{
|
||||
string text5 = ColorUtility.ToHtmlStringRGB(Settings.SearchedColor);
|
||||
text2 = text2 + "<color=#" + text5 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Common:
|
||||
{
|
||||
string text4 = ColorUtility.ToHtmlStringRGB(Settings.CommonItemColor);
|
||||
text2 = text2 + "<color=#" + text4 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(text2))
|
||||
{
|
||||
text += text2;
|
||||
text3 = "<color=cyan>[</color>" + text + "<color=cyan>]</color>";
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
GUI.Label(new Rect(vector.x - (float)lineX - (float)xOffset - 8f, vector.y - (float)num - (float)itemLineHeight + 3f, 200f, itemLineHeight), text3 ?? "", style);
|
||||
}
|
||||
}
|
||||
if (!(!Settings.DrawSimpleStrings || flag) || 0 >= corpse.LootItems.Count((ContainerItem item) => GameUtils.ShouldDisplayItem(item)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num2 = corpse.LootItems.Count((ContainerItem item) => GameUtils.ShouldDisplayItem(item));
|
||||
if (num2 <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
new GUIStyle();
|
||||
Texture2D texture2D = new Texture2D(1, 1);
|
||||
texture2D.SetPixel(0, 0, Color.yellow);
|
||||
texture2D.Apply();
|
||||
int? totalprice = corpse.totalprice;
|
||||
GUI.DrawTexture(new Rect(vector.x - (float)lineX, vector.y - (float)num, lineWidth, num2 * itemLineHeight + itemLineHeight - 25), texture2D);
|
||||
string text12 = ((totalprice.HasValue && Settings.drawvalue) ? $"Dead Body [{totalprice / 1000}K] - {corpse.FormattedDistance} " : ("Dead Body - " + corpse.FormattedDistance + " "));
|
||||
GUI.Label(new Rect(vector.x - (float)lineX - (float)xOffset - 8f, vector.y - (float)num - (float)itemLineHeight + 3f, 200f, itemLineHeight), text12, style);
|
||||
int num3 = num + itemLineHeight / 3;
|
||||
foreach (ContainerItem lootItem2 in corpse.LootItems)
|
||||
{
|
||||
if (GameUtils.ShouldDisplayItem(lootItem2))
|
||||
{
|
||||
string shortName = lootItem2.ShortName;
|
||||
int count = lootItem2.Count;
|
||||
Color itemColor = GameUtils.GetItemColor(lootItem2.Itemcat);
|
||||
string text13 = ((count > 1) ? $" ({count})" : "");
|
||||
int? num4 = null;
|
||||
if (Settings.drawvalue)
|
||||
{
|
||||
num4 = lootItem2.itemprice;
|
||||
}
|
||||
string text14 = ((num4.HasValue && Settings.drawvalue) ? $"{shortName} [{num4 / 1000}K]{text13}" : (shortName + text13));
|
||||
gUIStyle.normal.textColor = itemColor;
|
||||
GUI.Label(new Rect(vector.x - (float)lineX - (float)xOffset, vector.y - (float)(num3 - itemLineHeight) - 16f, 200f, itemLineHeight), text14, gUIStyle);
|
||||
num3 -= itemLineHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
401
stoopid.raw/stupid.solutions.Features.ESP/Crosshairetc.cs
Normal file
401
stoopid.raw/stupid.solutions.Features.ESP/Crosshairetc.cs
Normal file
|
|
@ -0,0 +1,401 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using EFT;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.enums;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
public class Crosshairetc : MonoBehaviour
|
||||
{
|
||||
public float lineLength = 20f;
|
||||
|
||||
public float lineThickness = 2f;
|
||||
|
||||
private Texture2D crosshairTexture;
|
||||
|
||||
public static float skeletonLineThickness = 1.7f;
|
||||
|
||||
public static float headCircleThickness = 1.7f;
|
||||
|
||||
private static Stopwatch memoryCheckTimer = Stopwatch.StartNew();
|
||||
|
||||
private static long lastLoggedMemory = 0L;
|
||||
|
||||
private static int logInterval = 5000;
|
||||
|
||||
private static Dictionary<Player, (Dictionary<HumanBones, Vector3> bones, float lastUpdateTime)> GamePlayerBoneCache = new Dictionary<Player, (Dictionary<HumanBones, Vector3>, float)>();
|
||||
|
||||
private static Dictionary<Player, (Dictionary<ZombieBones, Vector3> bones, float lastUpdateTime)> zombieBoneCache = new Dictionary<Player, (Dictionary<ZombieBones, Vector3>, float)>();
|
||||
|
||||
private bool clearcache;
|
||||
|
||||
private static float cacheExpirationInterval = Settings.cachedelayskelet;
|
||||
|
||||
private Color cachedcrosshaircolor;
|
||||
|
||||
private static readonly List<ZombieBones> NeededZombieBones = new List<ZombieBones>
|
||||
{
|
||||
ZombieBones.Base_HumanPelvis,
|
||||
ZombieBones.Base_HumanLThigh1,
|
||||
ZombieBones.Base_HumanLCalf,
|
||||
ZombieBones.Base_HumanLFoot,
|
||||
ZombieBones.Base_HumanRThigh1,
|
||||
ZombieBones.Base_HumanRCalf,
|
||||
ZombieBones.Base_HumanRFoot,
|
||||
ZombieBones.Base_HumanSpine2,
|
||||
ZombieBones.Base_HumanSpine3,
|
||||
ZombieBones.Base_HumanNeck,
|
||||
ZombieBones.Base_HumanHead,
|
||||
ZombieBones.Base_HumanLCollarbone,
|
||||
ZombieBones.Base_HumanLUpperarm,
|
||||
ZombieBones.Base_HumanLForearm1,
|
||||
ZombieBones.Base_HumanLForearm2,
|
||||
ZombieBones.Base_HumanLPalm,
|
||||
ZombieBones.Base_HumanRCollarbone,
|
||||
ZombieBones.Base_HumanRUpperarm,
|
||||
ZombieBones.Base_HumanRForearm1,
|
||||
ZombieBones.Base_HumanRForearm2,
|
||||
ZombieBones.Base_HumanRPalm
|
||||
};
|
||||
|
||||
private static readonly List<HumanBones> NeededBones = new List<HumanBones>
|
||||
{
|
||||
HumanBones.HumanPelvis,
|
||||
HumanBones.HumanLThigh1,
|
||||
HumanBones.HumanLThigh2,
|
||||
HumanBones.HumanLCalf,
|
||||
HumanBones.HumanLFoot,
|
||||
HumanBones.HumanLToe,
|
||||
HumanBones.HumanPelvis,
|
||||
HumanBones.HumanRThigh1,
|
||||
HumanBones.HumanRThigh2,
|
||||
HumanBones.HumanRCalf,
|
||||
HumanBones.HumanRFoot,
|
||||
HumanBones.HumanRToe,
|
||||
HumanBones.HumanSpine1,
|
||||
HumanBones.HumanSpine2,
|
||||
HumanBones.HumanSpine3,
|
||||
HumanBones.HumanNeck,
|
||||
HumanBones.HumanHead,
|
||||
HumanBones.HumanLCollarbone,
|
||||
HumanBones.HumanLForearm1,
|
||||
HumanBones.HumanLForearm2,
|
||||
HumanBones.HumanLForearm3,
|
||||
HumanBones.HumanLPalm,
|
||||
HumanBones.HumanLDigit11,
|
||||
HumanBones.HumanLDigit12,
|
||||
HumanBones.HumanLDigit13,
|
||||
HumanBones.HumanRCollarbone,
|
||||
HumanBones.HumanRForearm1,
|
||||
HumanBones.HumanRForearm2,
|
||||
HumanBones.HumanRForearm3,
|
||||
HumanBones.HumanRPalm,
|
||||
HumanBones.HumanRDigit11,
|
||||
HumanBones.HumanRDigit12,
|
||||
HumanBones.HumanRDigit13
|
||||
};
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Main.GameWorld != null && Main.MainCamera != null)
|
||||
{
|
||||
clearcache = true;
|
||||
}
|
||||
if (Main.GameWorld == null && clearcache)
|
||||
{
|
||||
zombieBoneCache.Clear();
|
||||
GamePlayerBoneCache.Clear();
|
||||
}
|
||||
if (cachedcrosshaircolor != Settings.CrosshairColor)
|
||||
{
|
||||
ReapplyCrosshairColour();
|
||||
}
|
||||
}
|
||||
|
||||
private void LogMemoryUsage()
|
||||
{
|
||||
long totalMemory = GC.GetTotalMemory(forceFullCollection: false);
|
||||
long num = totalMemory - lastLoggedMemory;
|
||||
ConsoleScreen.Log($"Memory Usage: {totalMemory / 1048576} MB (+{num / 1048576} MB since last log)");
|
||||
if (Main.GameWorld != null)
|
||||
{
|
||||
ConsoleScreen.Log($"Registered Players: {Main.GameWorld.RegisteredPlayers.Count}");
|
||||
ConsoleScreen.Log($"Loot Items: {Main.GameWorld.LootItems.Count}");
|
||||
}
|
||||
lastLoggedMemory = totalMemory;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
cachedcrosshaircolor = Settings.CrosshairColor;
|
||||
crosshairTexture = new Texture2D(1, 1);
|
||||
crosshairTexture.SetPixel(0, 0, Settings.CrosshairColor);
|
||||
crosshairTexture.Apply();
|
||||
}
|
||||
|
||||
public void ReapplyCrosshairColour()
|
||||
{
|
||||
cachedcrosshaircolor = Settings.CrosshairColor;
|
||||
crosshairTexture = new Texture2D(1, 1);
|
||||
crosshairTexture.SetPixel(0, 0, Settings.CrosshairColor);
|
||||
crosshairTexture.Apply();
|
||||
}
|
||||
|
||||
private static bool IsZombie(Player player)
|
||||
{
|
||||
WildSpawnType role = player.Profile.Info.Settings.Role;
|
||||
if (role != WildSpawnType.infectedAssault && role != WildSpawnType.infectedCivil && role != WildSpawnType.infectedLaborant)
|
||||
{
|
||||
return role == WildSpawnType.infectedPmc;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (Settings.AimbotDrawFOV && Menu2.showmenu)
|
||||
{
|
||||
Render.DrawCircle(new Vector2(Screen.width / 2, Screen.height / 2), Settings.AimbotFOV * 15.7f, 32, Settings.AimFOVColor);
|
||||
}
|
||||
if (Settings.Crosshair && Menu2.showmenu)
|
||||
{
|
||||
float num = Screen.width / 2;
|
||||
float num2 = Screen.height / 2;
|
||||
GUI.DrawTexture(new Rect(num - lineLength / 2f, num2 - lineThickness / 2f, lineLength, lineThickness), crosshairTexture);
|
||||
GUI.DrawTexture(new Rect(num - lineThickness / 2f, num2 - lineLength / 2f, lineThickness, lineLength), crosshairTexture);
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
if (!gamePlayer.IsOnScreen || gamePlayer.Distance > Settings.DrawPlayersDistance || gamePlayer.Player == Main.LocalPlayer)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (Settings.DrawPlayers && Settings.EnableSkeleton)
|
||||
{
|
||||
if (IsZombie(gamePlayer.Player))
|
||||
{
|
||||
DrawZombies(gamePlayer.Player);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSkeleton(gamePlayer.Player);
|
||||
}
|
||||
}
|
||||
if (Settings.drawaimpos && Settings.DrawPlayers)
|
||||
{
|
||||
DrawAim(gamePlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawAim(GamePlayer gamePlayer)
|
||||
{
|
||||
Vector3 vector = GameUtils.WorldPointToScreenPoint(RayCast.BarrelRayCast(gamePlayer.Player));
|
||||
Render.DrawLine(GameUtils.WorldPointToScreenPoint(gamePlayer.Player.Fireport.position), vector, 1f, Color.red);
|
||||
}
|
||||
|
||||
private static Dictionary<HumanBones, Vector3> GetBones(Player gamePlayer)
|
||||
{
|
||||
float time = Time.time;
|
||||
if (GamePlayerBoneCache.TryGetValue(gamePlayer, out (Dictionary<HumanBones, Vector3>, float) value) && time - value.Item2 < cacheExpirationInterval)
|
||||
{
|
||||
return value.Item1;
|
||||
}
|
||||
Dictionary<HumanBones, Vector3> dictionary = new Dictionary<HumanBones, Vector3>();
|
||||
if (gamePlayer.PlayerBody == null || gamePlayer.PlayerBody.SkeletonRootJoint == null)
|
||||
{
|
||||
return dictionary;
|
||||
}
|
||||
List<Transform> list = gamePlayer.PlayerBody.SkeletonRootJoint.Bones.Values.ToList();
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
Transform transform = list[i];
|
||||
if (transform != null && NeededBones.Contains((HumanBones)i))
|
||||
{
|
||||
Vector3 position = transform.position;
|
||||
if (GameUtils.IsScreenPointVisible(Main.ActiveCamera.WorldToScreenPoint(position)))
|
||||
{
|
||||
dictionary[(HumanBones)i] = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
GamePlayerBoneCache[gamePlayer] = (dictionary, time);
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
private static void DrawSkeleton(Player gamePlayer)
|
||||
{
|
||||
Dictionary<HumanBones, Vector3> bones = GetBones(gamePlayer);
|
||||
if (bones.Count != 0)
|
||||
{
|
||||
GL.PushMatrix();
|
||||
GameUtils.DrawMaterial.SetPass(0);
|
||||
GL.LoadProjectionMatrix(Main.ActiveCamera.projectionMatrix);
|
||||
GL.modelview = Main.ActiveCamera.worldToCameraMatrix;
|
||||
GL.Begin(1);
|
||||
ConnectBonesGL(bones, HumanBones.HumanPelvis, HumanBones.HumanLThigh1, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLThigh1, HumanBones.HumanLThigh2, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLThigh2, HumanBones.HumanLCalf, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLCalf, HumanBones.HumanLFoot, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLFoot, HumanBones.HumanLToe, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanPelvis, HumanBones.HumanRThigh1, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRThigh1, HumanBones.HumanRThigh2, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRThigh2, HumanBones.HumanRCalf, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRCalf, HumanBones.HumanRFoot, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRFoot, HumanBones.HumanRToe, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanPelvis, HumanBones.HumanSpine1, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanSpine1, HumanBones.HumanSpine2, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanSpine2, HumanBones.HumanSpine3, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanSpine3, HumanBones.HumanNeck, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanNeck, HumanBones.HumanHead, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanSpine3, HumanBones.HumanLCollarbone, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLCollarbone, HumanBones.HumanLForearm1, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLForearm1, HumanBones.HumanLForearm2, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLForearm2, HumanBones.HumanLForearm3, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanLForearm3, HumanBones.HumanLPalm, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanSpine3, HumanBones.HumanRCollarbone, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRCollarbone, HumanBones.HumanRForearm1, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRForearm1, HumanBones.HumanRForearm2, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRForearm2, HumanBones.HumanRForearm3, gamePlayer);
|
||||
ConnectBonesGL(bones, HumanBones.HumanRForearm3, HumanBones.HumanRPalm, gamePlayer);
|
||||
GL.End();
|
||||
GL.PopMatrix();
|
||||
if (bones.ContainsKey(HumanBones.HumanHead) && bones.ContainsKey(HumanBones.HumanNeck))
|
||||
{
|
||||
Vector3 vector = bones[HumanBones.HumanHead];
|
||||
Vector3 b = bones[HumanBones.HumanNeck];
|
||||
float num = Vector3.Distance(vector, b);
|
||||
float num2 = Vector3.Distance(Main.LocalPlayer.Transform.position, gamePlayer.Transform.position);
|
||||
float thickness = headCircleThickness / (num2 * 0.1f);
|
||||
int segments = ((num2 < 20f) ? 128 : 32);
|
||||
DrawHeadCircleGL(vector, num * 1.15f, segments, Settings.SkeletonColor, thickness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ConnectBonesGL(Dictionary<HumanBones, Vector3> bones, HumanBones start, HumanBones stop, Player gamePlayer)
|
||||
{
|
||||
if (bones.ContainsKey(start) && bones.ContainsKey(stop))
|
||||
{
|
||||
Vector3 v = bones[start];
|
||||
Vector3 v2 = bones[stop];
|
||||
GL.Color(Settings.SkeletonColor);
|
||||
GL.Vertex(v);
|
||||
GL.Vertex(v2);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawHeadCircleGL(Vector3 center, float radius, int segments, Color color, float thickness)
|
||||
{
|
||||
GL.PushMatrix();
|
||||
GameUtils.DrawMaterial.SetPass(0);
|
||||
GL.LoadProjectionMatrix(Main.ActiveCamera.projectionMatrix);
|
||||
GL.modelview = Main.ActiveCamera.worldToCameraMatrix;
|
||||
GL.Begin(1);
|
||||
GL.Color(color);
|
||||
float num = 360f / (float)segments;
|
||||
for (int i = 0; i < segments; i++)
|
||||
{
|
||||
float f = (float)Math.PI / 180f * ((float)i * num);
|
||||
float f2 = (float)Math.PI / 180f * ((float)(i + 1) * num);
|
||||
Vector3 v = center + new Vector3(Mathf.Cos(f) * radius, Mathf.Sin(f) * radius, 0f);
|
||||
Vector3 v2 = center + new Vector3(Mathf.Cos(f2) * radius, Mathf.Sin(f2) * radius, 0f);
|
||||
GL.Vertex(v);
|
||||
GL.Vertex(v2);
|
||||
}
|
||||
GL.End();
|
||||
GL.PopMatrix();
|
||||
}
|
||||
|
||||
private static void ConnectZombieBones(Dictionary<ZombieBones, Vector3> bones, ZombieBones start, ZombieBones stop, Player gamePlayer)
|
||||
{
|
||||
if (bones.ContainsKey(start) && bones.ContainsKey(stop))
|
||||
{
|
||||
Vector3 v = bones[start];
|
||||
Vector3 v2 = bones[stop];
|
||||
GL.Color(Settings.SkeletonColor);
|
||||
GL.Vertex(v);
|
||||
GL.Vertex(v2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawZombies(Player gamePlayer)
|
||||
{
|
||||
Dictionary<ZombieBones, Vector3> zombieBones = GetZombieBones(gamePlayer);
|
||||
if (zombieBones.Count != 0)
|
||||
{
|
||||
GL.PushMatrix();
|
||||
GameUtils.DrawMaterial.SetPass(0);
|
||||
GL.LoadProjectionMatrix(Main.ActiveCamera.projectionMatrix);
|
||||
GL.modelview = Main.ActiveCamera.worldToCameraMatrix;
|
||||
GL.Begin(1);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanPelvis, ZombieBones.Base_HumanLThigh1, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanPelvis, ZombieBones.Base_HumanRThigh1, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanLThigh1, ZombieBones.Base_HumanLCalf, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanLCalf, ZombieBones.Base_HumanLFoot, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanRThigh1, ZombieBones.Base_HumanRCalf, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanRCalf, ZombieBones.Base_HumanRFoot, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanPelvis, ZombieBones.Base_HumanSpine2, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanSpine2, ZombieBones.Base_HumanSpine3, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanSpine3, ZombieBones.Base_HumanNeck, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanNeck, ZombieBones.Base_HumanHead, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanSpine3, ZombieBones.Base_HumanLCollarbone, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanLCollarbone, ZombieBones.Base_HumanLUpperarm, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanLUpperarm, ZombieBones.Base_HumanLForearm1, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanLForearm1, ZombieBones.Base_HumanLForearm2, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanLForearm2, ZombieBones.Base_HumanLPalm, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanSpine3, ZombieBones.Base_HumanRCollarbone, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanRCollarbone, ZombieBones.Base_HumanRUpperarm, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanRUpperarm, ZombieBones.Base_HumanRForearm1, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanRForearm1, ZombieBones.Base_HumanRForearm2, gamePlayer);
|
||||
ConnectZombieBones(zombieBones, ZombieBones.Base_HumanRForearm2, ZombieBones.Base_HumanRPalm, gamePlayer);
|
||||
GL.End();
|
||||
GL.PopMatrix();
|
||||
if (zombieBones.ContainsKey(ZombieBones.Base_HumanHead) && zombieBones.ContainsKey(ZombieBones.Base_HumanNeck))
|
||||
{
|
||||
Vector3 vector = zombieBones[ZombieBones.Base_HumanHead];
|
||||
Vector3 b = zombieBones[ZombieBones.Base_HumanNeck];
|
||||
float num = Vector3.Distance(vector, b);
|
||||
float num2 = Vector3.Distance(Main.LocalPlayer.Transform.position, gamePlayer.Transform.position);
|
||||
float thickness = headCircleThickness / (num2 * 0.1f);
|
||||
int segments = ((num2 < 20f) ? 128 : 32);
|
||||
DrawHeadCircleGL(vector, num * 1.15f, segments, Settings.SkeletonColor, thickness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<ZombieBones, Vector3> GetZombieBones(Player gamePlayer)
|
||||
{
|
||||
float time = Time.time;
|
||||
if (zombieBoneCache.TryGetValue(gamePlayer, out (Dictionary<ZombieBones, Vector3>, float) value) && time - value.Item2 < cacheExpirationInterval)
|
||||
{
|
||||
return value.Item1;
|
||||
}
|
||||
Dictionary<ZombieBones, Vector3> dictionary = new Dictionary<ZombieBones, Vector3>();
|
||||
if (gamePlayer.PlayerBody == null || gamePlayer.PlayerBody.SkeletonRootJoint == null)
|
||||
{
|
||||
return dictionary;
|
||||
}
|
||||
List<Transform> list = gamePlayer.PlayerBody.SkeletonRootJoint.Bones.Values.ToList();
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
Transform transform = list[i];
|
||||
if (transform != null && NeededZombieBones.Contains((ZombieBones)i))
|
||||
{
|
||||
Vector3 position = transform.position;
|
||||
if (GameUtils.IsScreenPointVisible(Main.ActiveCamera.WorldToScreenPoint(position)))
|
||||
{
|
||||
dictionary[(ZombieBones)i] = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
zombieBoneCache[gamePlayer] = (dictionary, time);
|
||||
return dictionary;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
using System.Collections.Generic;
|
||||
using EFT.Interactive;
|
||||
using EFT.InventoryLogic;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
public class ExfiltrationPointsESP : MonoBehaviour
|
||||
{
|
||||
private List<GameExfiltrationPoint> _gameExfiltrationPoints = new List<GameExfiltrationPoint>();
|
||||
|
||||
private List<GameTransitPoint> _gameTransitPoints = new List<GameTransitPoint>();
|
||||
|
||||
private static readonly float CacheExfiltrationPointInterval = 5f;
|
||||
|
||||
private float _nextLootItemCacheTime;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Time.time >= _nextLootItemCacheTime && Main.GameWorld != null && Main.GameWorld.ExfiltrationController.ExfiltrationPoints != null)
|
||||
{
|
||||
_gameExfiltrationPoints.Clear();
|
||||
ExfiltrationPoint[] exfiltrationPoints = Main.GameWorld.ExfiltrationController.ExfiltrationPoints;
|
||||
foreach (ExfiltrationPoint exfiltrationPoint in exfiltrationPoints)
|
||||
{
|
||||
if (GameUtils.IsExfiltrationPointValid(exfiltrationPoint))
|
||||
{
|
||||
_gameExfiltrationPoints.Add(new GameExfiltrationPoint(exfiltrationPoint));
|
||||
}
|
||||
}
|
||||
foreach (TransitPoint transitPoint in LocationsFixerV2.transitPoints)
|
||||
{
|
||||
if (GameUtils.IsTransitPointValid(transitPoint))
|
||||
{
|
||||
_gameTransitPoints.Add(new GameTransitPoint(transitPoint));
|
||||
}
|
||||
}
|
||||
_nextLootItemCacheTime = Time.time + CacheExfiltrationPointInterval;
|
||||
}
|
||||
if (!(Main.GameWorld != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GameExfiltrationPoint gameExfiltrationPoint in _gameExfiltrationPoints)
|
||||
{
|
||||
gameExfiltrationPoint.RecalculateDynamics();
|
||||
}
|
||||
foreach (GameTransitPoint gameTransitPoint in _gameTransitPoints)
|
||||
{
|
||||
gameTransitPoint.RecalculateDynamics();
|
||||
}
|
||||
}
|
||||
|
||||
private string RemoveUnderscores(string input)
|
||||
{
|
||||
return input.Replace("_", " ");
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!(Main.GameWorld != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Settings.DrawExfiltrationPoints)
|
||||
{
|
||||
foreach (GameExfiltrationPoint gameExfiltrationPoint in _gameExfiltrationPoints)
|
||||
{
|
||||
if (GameUtils.IsExfiltrationPointValid(gameExfiltrationPoint.ExfiltrationPoint) && gameExfiltrationPoint.IsOnScreen)
|
||||
{
|
||||
string text = ColorUtility.ToHtmlStringRGB(Settings.ExfilESPColor);
|
||||
string text2 = ColorUtility.ToHtmlStringRGB((gameExfiltrationPoint.status == "Open") ? Color.green : Color.red);
|
||||
string label = "<color=#" + text + ">" + RemoveUnderscores(gameExfiltrationPoint.ExfiltrationPoint.Settings.Name) + " - </color><color=#" + text2 + ">" + gameExfiltrationPoint.status + "</color> <color=#" + text + ">[" + gameExfiltrationPoint.FormattedDistance + "]</color>";
|
||||
Render.DrawRichTextString(new Vector2(gameExfiltrationPoint.ScreenPosition.x - 50f, gameExfiltrationPoint.ScreenPosition.y), label, Color.white);
|
||||
}
|
||||
}
|
||||
foreach (GameTransitPoint gameTransitPoint in _gameTransitPoints)
|
||||
{
|
||||
if (GameUtils.IsTransitPointValid(gameTransitPoint.transitPoint) && gameTransitPoint.IsOnScreen)
|
||||
{
|
||||
string label2 = " " + RemoveUnderscores(gameTransitPoint.transitPoint.name) + " [" + gameTransitPoint.FormattedDistance + "] ";
|
||||
Render.DrawString(new Vector2(gameTransitPoint.ScreenPosition.x - 50f, gameTransitPoint.ScreenPosition.y), label2, Settings.TransitPointColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Main.LocalPlayerWeapon == null || !(Main.LocalPlayer != null) || !Settings.DrawInfo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string label3 = string.Empty;
|
||||
if (Main.LocalPlayer.HandsController.Item is Weapon)
|
||||
{
|
||||
Weapon localPlayerWeapon = Main.LocalPlayerWeapon;
|
||||
_EF1A currentMagazine = localPlayerWeapon.GetCurrentMagazine();
|
||||
if (currentMagazine != null)
|
||||
{
|
||||
label3 = $" {currentMagazine.Count + localPlayerWeapon.ChamberAmmoCount}/{currentMagazine.MaxCount + localPlayerWeapon.ChamberAmmoCount} ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
label3 = "";
|
||||
}
|
||||
float x = Screen.width / 2;
|
||||
float num = Screen.height / 2;
|
||||
Render.DrawString(new Vector2(x, num + 60f), label3, Settings.AmmoCounterColor);
|
||||
}
|
||||
}
|
||||
256
stoopid.raw/stupid.solutions.Features.ESP/ItemESP.cs
Normal file
256
stoopid.raw/stupid.solutions.Features.ESP/ItemESP.cs
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
using System.Collections.Generic;
|
||||
using EFT.Interactive;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
public class ItemESP : MonoBehaviour
|
||||
{
|
||||
private static readonly float CacheLootItemsInterval = 5f;
|
||||
|
||||
private static readonly float clearcacheinterval = 600f;
|
||||
|
||||
private float _nextclearCacheTime;
|
||||
|
||||
private float _nextLootItemCacheTime;
|
||||
|
||||
public static List<GameLootItem> _gameLootItems = new List<GameLootItem>();
|
||||
|
||||
private Dictionary<Renderer, Shader> originalWeaponShaders = new Dictionary<Renderer, Shader>();
|
||||
|
||||
private bool addedwishitems;
|
||||
|
||||
private static Shader _cachedForceFieldShader;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Main.GameWorld == null && _gameLootItems.Count > 0)
|
||||
{
|
||||
_gameLootItems.Clear();
|
||||
}
|
||||
if (!Settings.DrawLootableContainers && !Settings.DrawLootItems)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.LocalPlayer != null && !addedwishitems)
|
||||
{
|
||||
Main.GetWishlistItems();
|
||||
addedwishitems = true;
|
||||
ConsoleScreen.Log("Added wishlist items");
|
||||
}
|
||||
else if (Main.LocalPlayer == null && addedwishitems)
|
||||
{
|
||||
ClearWishlistItems();
|
||||
}
|
||||
if (!Settings.DrawLootItems)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Time.time >= _nextLootItemCacheTime)
|
||||
{
|
||||
CacheLootItems();
|
||||
_nextLootItemCacheTime = Time.time + CacheLootItemsInterval;
|
||||
}
|
||||
_gameLootItems.RemoveAll((GameLootItem li) => !GameUtils.IsLootItemValid(li.LootItem) || li == null || li.LootItem.transform == null);
|
||||
foreach (GameLootItem gameLootItem in _gameLootItems)
|
||||
{
|
||||
if (gameLootItem != null && GameUtils.IsLootItemValid(gameLootItem.LootItem))
|
||||
{
|
||||
if (Main.GameWorld == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
gameLootItem.RecalculateDynamics();
|
||||
if (gameLootItem.Itemcat == ItemCategories.Uninitialized)
|
||||
{
|
||||
gameLootItem.SetItemCat();
|
||||
}
|
||||
if (!gameLootItem.itemprice.HasValue)
|
||||
{
|
||||
gameLootItem.CalculateItemPrice();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Time.time >= _nextclearCacheTime)
|
||||
{
|
||||
_gameLootItems.Clear();
|
||||
_nextclearCacheTime = Time.time + clearcacheinterval;
|
||||
ConsoleScreen.Log("memory cleaned");
|
||||
}
|
||||
}
|
||||
|
||||
private void CacheLootItems()
|
||||
{
|
||||
if (Main.GameWorld == null || Main.GameWorld.LootItems == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int num = 0;
|
||||
for (int i = 0; i < Main.GameWorld.LootItems.Count; i++)
|
||||
{
|
||||
LootItem byIndex = Main.GameWorld.LootItems.GetByIndex(i);
|
||||
if (!(byIndex == null) && GameUtils.IsLootItemValid(byIndex))
|
||||
{
|
||||
_ = byIndex.transform.position;
|
||||
if (!(byIndex.Item.LocalizedName() == "Default Inventory"))
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_gameLootItems.Count == num)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_gameLootItems.Clear();
|
||||
ConsoleScreen.Log("Item ESP Item Instance Mismatch, Updating...");
|
||||
for (int j = 0; j < Main.GameWorld.LootItems.Count; j++)
|
||||
{
|
||||
LootItem byIndex2 = Main.GameWorld.LootItems.GetByIndex(j);
|
||||
if (!(byIndex2 == null) && GameUtils.IsLootItemValid(byIndex2))
|
||||
{
|
||||
_ = byIndex2.transform.position;
|
||||
if (!(byIndex2.Item.LocalizedName() == "Default Inventory"))
|
||||
{
|
||||
_gameLootItems.Add(new GameLootItem(byIndex2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearWishlistItems()
|
||||
{
|
||||
Main.wishlistitemids.Clear();
|
||||
Main.hideoutitemids.Clear();
|
||||
addedwishitems = false;
|
||||
}
|
||||
|
||||
private void RenderItemESP()
|
||||
{
|
||||
List<(Vector2, string, Color)> list = new List<(Vector2, string, Color)>();
|
||||
foreach (GameLootItem gameLootItem in _gameLootItems)
|
||||
{
|
||||
if (gameLootItem != null && gameLootItem.IsOnScreen && !(gameLootItem.Distance > Settings.DrawLootItemsDistance))
|
||||
{
|
||||
_ = gameLootItem.LocalizedName;
|
||||
_ = gameLootItem.ItemID;
|
||||
string localizedName = gameLootItem.LocalizedName;
|
||||
localizedName = ((!(gameLootItem.stackcount > 1)) ? gameLootItem.LocalizedName : $"{gameLootItem.LocalizedName}({gameLootItem.stackcount})");
|
||||
int? itemprice = gameLootItem.itemprice;
|
||||
bool flag = true;
|
||||
if (Settings.DrawSimpleStrings)
|
||||
{
|
||||
Vector3 position = gameLootItem.LootItem.gameObject.transform.position;
|
||||
flag = Aimbot.CaulculateInFov2(new Vector3(position.x, position.y, position.z)) <= Settings.SimpleStringsFOV;
|
||||
}
|
||||
string text = ((Settings.drawvalue && itemprice.HasValue) ? $"{localizedName} [{itemprice / 1000}K] - {gameLootItem.FormattedDistance} " : (localizedName + " - " + gameLootItem.FormattedDistance + " "));
|
||||
string text2 = " + ";
|
||||
string item = ((!Settings.DrawSimpleStrings) ? text : (flag ? text : text2));
|
||||
ItemCategories itemcat = gameLootItem.Itemcat;
|
||||
Vector2 screenPositionFinal = gameLootItem.ScreenPositionFinal;
|
||||
Color itemColor = GameUtils.GetItemColor(itemcat);
|
||||
if (itemcat == ItemCategories.Quest && Settings.quest)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Superrare && Settings.superrare)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Kappa && Settings.kappa)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Stim && Settings.stim)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Searched && Settings.searchItem)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Wishlist && Settings.drawwishlistitem)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Hideout && Settings.drawhideoutitems)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (itemcat == ItemCategories.Common && Settings.common && gameLootItem.Distance < Settings.commonitemdistance)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
else if (gameLootItem.itemprice > Settings.ESPPRICEfiltervalue && Settings.ESPFilterbyprice)
|
||||
{
|
||||
list.Add((screenPositionFinal, item, itemColor));
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var (position2, label, color) in list)
|
||||
{
|
||||
Render.DrawString(position2, label, color);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (Settings.DrawLootItems && !(Main.GameWorld == null) && !(Main.LocalPlayer == null))
|
||||
{
|
||||
RenderItemESP();
|
||||
if (Settings.weaponchams)
|
||||
{
|
||||
weaponChams();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void weaponChams()
|
||||
{
|
||||
if (Main.GameWorld == null || !Settings.weaponchams)
|
||||
{
|
||||
ResetWeaponChams();
|
||||
return;
|
||||
}
|
||||
if (_cachedForceFieldShader == null)
|
||||
{
|
||||
_cachedForceFieldShader = Main.bundle.LoadAsset<Shader>("wireframe.shader");
|
||||
}
|
||||
Renderer[] componentsInChildren = Main.LocalPlayer.GetComponentsInChildren<Renderer>();
|
||||
foreach (Renderer renderer in componentsInChildren)
|
||||
{
|
||||
Material material = renderer.material;
|
||||
if (!(material == null))
|
||||
{
|
||||
if (!originalWeaponShaders.ContainsKey(renderer))
|
||||
{
|
||||
originalWeaponShaders[renderer] = material.shader;
|
||||
}
|
||||
material.shader = _cachedForceFieldShader;
|
||||
material.SetColor("_VisibleColor", Settings.SelfChamsColor);
|
||||
material.SetColor("_InvisibleColor", Settings.SelfChamsColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetWeaponChams()
|
||||
{
|
||||
Renderer[] componentsInChildren = Main.LocalPlayer.GetComponentsInChildren<Renderer>();
|
||||
foreach (Renderer renderer in componentsInChildren)
|
||||
{
|
||||
if (!(renderer == null) && originalWeaponShaders.ContainsKey(renderer))
|
||||
{
|
||||
Material material = renderer.material;
|
||||
if (!(material == null))
|
||||
{
|
||||
material.shader = originalWeaponShaders[renderer];
|
||||
material.SetColor("_Color", Color.white);
|
||||
}
|
||||
}
|
||||
}
|
||||
originalWeaponShaders.Clear();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EFT.Interactive;
|
||||
using EFT.InventoryLogic;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
public class LootableContainerESP : MonoBehaviour
|
||||
{
|
||||
private static readonly float CacheLootItemsInterval = 600f;
|
||||
|
||||
private float _nextLootContainerCacheTime;
|
||||
|
||||
public static List<GameLootContainer> _gameLootContainers;
|
||||
|
||||
private static readonly Color LootableContainerColor = new Color(1f, 0.2f, 0.09f);
|
||||
|
||||
private Dictionary<string, int?> lootItemPrices = new Dictionary<string, int?>();
|
||||
|
||||
private static readonly float ItemListCacheInterval = 10f;
|
||||
|
||||
private float _nextItemListCache;
|
||||
|
||||
private bool gameworldwasnotnull;
|
||||
|
||||
private bool repatchbecausenewgame;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_gameLootContainers = new List<GameLootContainer>();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!Settings.DrawLootableContainers)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((Time.time >= _nextLootContainerCacheTime || repatchbecausenewgame) && Main.GameWorld != null && Main.GameWorld.LootItems != null && Main.LocalPlayer != null && Main.MainCamera != null)
|
||||
{
|
||||
repatchbecausenewgame = false;
|
||||
_gameLootContainers.Clear();
|
||||
ConsoleScreen.Log("Getting Container Instances (game start)");
|
||||
LootableContainer[] array = Object.FindObjectsOfType<LootableContainer>();
|
||||
foreach (LootableContainer lootableContainer in array)
|
||||
{
|
||||
if (GameUtils.IsLootableContainerValid(lootableContainer))
|
||||
{
|
||||
_gameLootContainers.Add(new GameLootContainer(lootableContainer));
|
||||
}
|
||||
}
|
||||
_nextLootContainerCacheTime = Time.time + CacheLootItemsInterval;
|
||||
gameworldwasnotnull = true;
|
||||
}
|
||||
if (gameworldwasnotnull && Main.GameWorld == null)
|
||||
{
|
||||
repatchbecausenewgame = true;
|
||||
gameworldwasnotnull = false;
|
||||
}
|
||||
if (Main.GameWorld != null && _gameLootContainers.Count > 0)
|
||||
{
|
||||
foreach (GameLootContainer gameLootContainer2 in _gameLootContainers)
|
||||
{
|
||||
gameLootContainer2.RecalculateDynamics();
|
||||
}
|
||||
}
|
||||
if (!(Time.time >= _nextItemListCache))
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GameLootContainer gameLootContainer in _gameLootContainers)
|
||||
{
|
||||
if (gameLootContainer.LootableContainer.ItemOwner.RootItem.GetAllItems().Count((Item item) => item != null && !gameLootContainer.IsContainerName(item.LocalizedName())) != gameLootContainer.CachedItemCount)
|
||||
{
|
||||
gameLootContainer.RefreshItems();
|
||||
_ = gameLootContainer.ItemInit;
|
||||
}
|
||||
}
|
||||
_nextItemListCache = Time.time + ItemListCacheInterval;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!Settings.DrawLootableContainers || Main.MainCamera == null || (Main.GameWorld == null && Main.GameWorld.LootItems == null && Main.LocalPlayer == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
int xOffset = Settings.xOffset;
|
||||
int initialYOffset = Settings.initialYOffset;
|
||||
int itemLineHeight = Settings.itemLineHeight;
|
||||
int lineWidth = Settings.lineWidth;
|
||||
int lineX = Settings.lineX;
|
||||
GUIStyle style = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
alignment = TextAnchor.UpperLeft,
|
||||
fontSize = 12,
|
||||
font = Main.TXTFONT,
|
||||
normal = new GUIStyleState
|
||||
{
|
||||
textColor = Color.white
|
||||
}
|
||||
};
|
||||
GUIStyle gUIStyle = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
alignment = TextAnchor.UpperLeft,
|
||||
fontSize = 12,
|
||||
font = Main.TXTFONT
|
||||
};
|
||||
foreach (GameLootContainer gameLootContainer in _gameLootContainers)
|
||||
{
|
||||
if (!GameUtils.IsLootableContainerValid(gameLootContainer.LootableContainer) || !gameLootContainer.IsOnScreen || gameLootContainer.Distance > Settings.DrawLootableContainersDistance)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Vector2 vector = new Vector2(gameLootContainer.ScreenPosition.x, gameLootContainer.ScreenPosition.y);
|
||||
if (!gameLootContainer.ItemInit)
|
||||
{
|
||||
gameLootContainer.RefreshItems();
|
||||
}
|
||||
if (gameLootContainer.LootItems.Count <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Vector3 position = gameLootContainer.LootableContainer.transform.position;
|
||||
bool flag = Aimbot.CaulculateInFov2(new Vector3(position.x, position.y, position.z)) <= Settings.SimpleStringsFOV;
|
||||
if (Settings.DrawSimpleStrings)
|
||||
{
|
||||
string text = "";
|
||||
string text2 = "";
|
||||
foreach (ContainerItem lootItem in gameLootContainer.LootItems)
|
||||
{
|
||||
if (GameUtils.ShouldDisplayItem(lootItem))
|
||||
{
|
||||
switch (lootItem.Itemcat)
|
||||
{
|
||||
case ItemCategories.Kappa:
|
||||
{
|
||||
string text10 = ColorUtility.ToHtmlStringRGB(Settings.KappaColor);
|
||||
text2 = text2 + "<color=#" + text10 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Superrare:
|
||||
{
|
||||
string text9 = ColorUtility.ToHtmlStringRGB(Settings.SuperrareColor);
|
||||
text2 = text2 + "<color=#" + text9 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Stim:
|
||||
{
|
||||
string text8 = ColorUtility.ToHtmlStringRGB(Settings.StimItemColor);
|
||||
text2 = text2 + "<color=#" + text8 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Quest:
|
||||
{
|
||||
string text7 = ColorUtility.ToHtmlStringRGB(Settings.QuestItemColor);
|
||||
text2 = text2 + "<color=#" + text7 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Wishlist:
|
||||
{
|
||||
string text6 = ColorUtility.ToHtmlStringRGB(Settings.WishlistColor);
|
||||
text2 = text2 + "<color=#" + text6 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Hideout:
|
||||
{
|
||||
string text5 = ColorUtility.ToHtmlStringRGB(Settings.HideoutColor);
|
||||
text2 = text2 + "<color=#" + text5 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Searched:
|
||||
{
|
||||
string text4 = ColorUtility.ToHtmlStringRGB(Settings.SearchedColor);
|
||||
text2 = text2 + "<color=#" + text4 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
case ItemCategories.Common:
|
||||
{
|
||||
string text3 = ColorUtility.ToHtmlStringRGB(Settings.CommonItemColor);
|
||||
text2 = text2 + "<color=#" + text3 + ">+</color>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(text2))
|
||||
{
|
||||
text += text2;
|
||||
}
|
||||
if (!flag && 0 < gameLootContainer.LootItems.Count((ContainerItem item) => GameUtils.ShouldDisplayItem(item)))
|
||||
{
|
||||
if (gameLootContainer.LootItems.Count((ContainerItem item) => GameUtils.ShouldDisplayItem(item)) <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
GUI.Label(new Rect(vector.x - (float)lineX - (float)xOffset - 8f, vector.y - (float)initialYOffset - (float)itemLineHeight + 3f, 200f, itemLineHeight), " [" + text + "] ", style);
|
||||
}
|
||||
}
|
||||
if (!(!Settings.DrawSimpleStrings || flag) || 0 >= gameLootContainer.LootItems.Count((ContainerItem item) => GameUtils.ShouldDisplayItem(item)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num = gameLootContainer.LootItems.Count((ContainerItem item) => GameUtils.ShouldDisplayItem(item));
|
||||
if (num <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
new GUIStyle();
|
||||
Texture2D texture2D = new Texture2D(1, 1);
|
||||
texture2D.SetPixel(0, 0, Color.yellow);
|
||||
texture2D.Apply();
|
||||
GUI.DrawTexture(new Rect(vector.x - (float)lineX, vector.y - (float)initialYOffset, lineWidth, num * itemLineHeight + itemLineHeight - 25), texture2D);
|
||||
int? totalprice = gameLootContainer.totalprice;
|
||||
string text11 = "";
|
||||
GUI.Label(text: (!Settings.drawvalue || !totalprice.HasValue) ? (gameLootContainer.ContainerName + " - " + gameLootContainer.FormattedDistance) : $"{gameLootContainer.ContainerName} [{totalprice / 1000}K] - {gameLootContainer.FormattedDistance}", position: new Rect(vector.x - (float)lineX - (float)xOffset - 8f, vector.y - (float)initialYOffset - (float)itemLineHeight + 3f, 200f, itemLineHeight), style: style);
|
||||
int num2 = initialYOffset + itemLineHeight / 3;
|
||||
foreach (ContainerItem lootItem2 in gameLootContainer.LootItems)
|
||||
{
|
||||
if (GameUtils.ShouldDisplayItem(lootItem2))
|
||||
{
|
||||
string localizedName = lootItem2.LocalizedName;
|
||||
int count = lootItem2.Count;
|
||||
Color itemColor = GameUtils.GetItemColor(lootItem2.Itemcat);
|
||||
string text12 = ((count > 1) ? $" ({count})" : "");
|
||||
string text13 = "";
|
||||
int? itemprice = lootItem2.itemprice;
|
||||
text13 = ((!Settings.drawvalue || !totalprice.HasValue) ? (localizedName + text12 + " ") : $"{localizedName} [{itemprice / 1000}K]{text12} ");
|
||||
gUIStyle.normal.textColor = itemColor;
|
||||
GUI.Label(new Rect(vector.x - (float)lineX - (float)xOffset, vector.y - (float)(num2 - itemLineHeight) - 16f, 200f, itemLineHeight), text13, gUIStyle);
|
||||
num2 -= itemLineHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
332
stoopid.raw/stupid.solutions.Features.ESP/PlayerESP.cs
Normal file
332
stoopid.raw/stupid.solutions.Features.ESP/PlayerESP.cs
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using EFT;
|
||||
using EFT.InventoryLogic;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
public class PlayerESP : MonoBehaviour
|
||||
{
|
||||
private static readonly Color _healthColor = Color.green;
|
||||
|
||||
public static Color orange = Color.red;
|
||||
|
||||
private Color violet = new Color(148f, 0f, 211f);
|
||||
|
||||
public float lineLength = 20f;
|
||||
|
||||
public float lineThickness = 2f;
|
||||
|
||||
private static IEnumerator<Item> _equipItemList;
|
||||
|
||||
private Color ItemColor = Color.white;
|
||||
|
||||
private string _logFilePath;
|
||||
|
||||
private static HashSet<int> processedEntities = new HashSet<int>();
|
||||
|
||||
private static WildSpawnType WildSpawnType;
|
||||
|
||||
private bool shouldclear = true;
|
||||
|
||||
private bool shouldresetandclearchams;
|
||||
|
||||
private static readonly float ItemListCacheInterval = 30f;
|
||||
|
||||
private float _nextItemListCache;
|
||||
|
||||
private Dictionary<Renderer, Shader> originalShaders = new Dictionary<Renderer, Shader>();
|
||||
|
||||
private Dictionary<Renderer, (Color visibleColor, Color behindColor)> previousChamsColors = new Dictionary<Renderer, (Color, Color)>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_logFilePath = Path.Combine(Application.persistentDataPath, "log.txt");
|
||||
}
|
||||
|
||||
private void Log(string message)
|
||||
{
|
||||
using StreamWriter streamWriter = new StreamWriter(_logFilePath, append: true);
|
||||
streamWriter.WriteLine($"{DateTime.Now}: {message}");
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (Main.GameWorld == null && shouldclear)
|
||||
{
|
||||
processedEntities.Clear();
|
||||
shouldclear = false;
|
||||
originalShaders.Clear();
|
||||
previousChamsColors.Clear();
|
||||
}
|
||||
else if (Main.GameWorld != null && !shouldclear)
|
||||
{
|
||||
shouldclear = true;
|
||||
}
|
||||
if (Main.GameWorld == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Camera.main != null)
|
||||
{
|
||||
Camera.main.useOcclusionCulling = false;
|
||||
}
|
||||
if (!Settings.PlayerInventoryESP)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
if (!(Time.time >= _nextItemListCache) || gamePlayer.Player.Profile.Inventory.Equipment.GetAllItems().Count() < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num = 0;
|
||||
foreach (ContainerItem lootItem in gamePlayer.LootItems)
|
||||
{
|
||||
num += lootItem.Count * lootItem.Item.StackObjectsCount;
|
||||
}
|
||||
if (gamePlayer.Player.Profile.Inventory.Equipment.GetAllItems().Count() != num)
|
||||
{
|
||||
gamePlayer.RefreshItems();
|
||||
}
|
||||
gamePlayer.RefreshItems();
|
||||
_nextItemListCache = Time.time + ItemListCacheInterval;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (!Settings.DrawPlayers)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Settings.Chams)
|
||||
{
|
||||
Chams();
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
if (!gamePlayer.IsOnScreen || gamePlayer.Player == Main.LocalPlayer || (gamePlayer.Distance > Settings.DrawPlayersDistance && !gamePlayer.isselected))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
WildSpawnType role = gamePlayer.Player.Profile.Info.Settings.Role;
|
||||
Vector3 zero = Vector3.zero;
|
||||
zero = ((role == WildSpawnType.infectedAssault || role == WildSpawnType.infectedCivil || role == WildSpawnType.infectedLaborant || role == WildSpawnType.infectedPmc) ? GameUtils.GetBonePosByID(gamePlayer.Player, Aimbot.zombiebone) : GameUtils.GetBonePosByID(gamePlayer.Player, Settings.Aimbone));
|
||||
bool flag = Aimbot.CaulculateInFov(zero) <= Settings.AimbotFOV;
|
||||
int id = ((role == WildSpawnType.infectedAssault || role == WildSpawnType.infectedCivil || role == WildSpawnType.infectedLaborant || role == WildSpawnType.infectedPmc) ? 31 : 133);
|
||||
Vector3 bonePosByID = GameUtils.GetBonePosByID(gamePlayer.Player, id);
|
||||
RaycastHit raycastHit;
|
||||
bool flag2 = Aimbot.VisCheck(gamePlayer.Player.gameObject, Main.LocalPlayer.Fireport.position, bonePosByID, out raycastHit);
|
||||
float num = gamePlayer.HeadScreenPosition.y - 10f;
|
||||
float num2 = Math.Abs(gamePlayer.HeadScreenPosition.y - gamePlayer.ScreenPosition.y) + 10f;
|
||||
float num3 = num2 * 0.65f;
|
||||
if (Settings.DrawPlayerBox)
|
||||
{
|
||||
Vector2 position = new Vector2(gamePlayer.ScreenPosition.x - num3 / 2f, num);
|
||||
Vector2 size = new Vector2(num3, num2);
|
||||
Color color = ((!flag2) ? Settings.ESPBoxColor : Settings.boxsightline);
|
||||
Render.DrawCornerBox(position, size, 2f, color, 5f, centered: false);
|
||||
}
|
||||
if (Settings.DrawPlayerHealth)
|
||||
{
|
||||
if (Settings.DrawSimpleStrings)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
DrawHealth(gamePlayer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawHealth(gamePlayer);
|
||||
}
|
||||
}
|
||||
if (Settings.DrawPlayerName)
|
||||
{
|
||||
(string playerText, string shorttext, Color playerColor) playerTextDetails = GameUtils.GetPlayerTextDetails(gamePlayer, role);
|
||||
string item = playerTextDetails.playerText;
|
||||
string item2 = playerTextDetails.shorttext;
|
||||
Color item3 = playerTextDetails.playerColor;
|
||||
Vector2 vector = GUI.skin.GetStyle(item).CalcSize(new GUIContent(item));
|
||||
string text = ((Settings.DrawSimpleStrings && flag) ? item : (Settings.DrawSimpleStrings ? item2 : item));
|
||||
if (!gamePlayer.isselected)
|
||||
{
|
||||
Render.DrawString(new Vector2(gamePlayer.HeadScreenPosition.x, num - vector.y - 3f), text, item3);
|
||||
}
|
||||
else
|
||||
{
|
||||
Render.DrawString(new Vector2(gamePlayer.HeadScreenPosition.x, num - vector.y - 3f), " [+] Selected Player : " + text + " [+] ", Settings.SelectedEntityColor);
|
||||
}
|
||||
}
|
||||
if (Settings.DrawPlayerLine)
|
||||
{
|
||||
Render.DrawLine(new Vector2(Screen.width / 2, Screen.height), new Vector2(gamePlayer.ScreenPosition.x, gamePlayer.ScreenPosition.y), 1.5f, flag2 ? Settings.isvisibleline : Settings.ESPLineColor);
|
||||
}
|
||||
if (Settings.playerWeapon && gamePlayer.Player.HandsController != null)
|
||||
{
|
||||
string text2 = string.Empty;
|
||||
if (gamePlayer.Player.HandsController.Item is Weapon)
|
||||
{
|
||||
Weapon weapon = (Weapon)gamePlayer.Player.HandsController.Item;
|
||||
_EF1A currentMagazine = weapon.GetCurrentMagazine();
|
||||
if (currentMagazine != null)
|
||||
{
|
||||
string arg = ColorUtility.ToHtmlStringRGB(Settings.EnemyAmmoCounterColor);
|
||||
text2 = $"<color=#{arg}>({currentMagazine.Count + weapon.ChamberAmmoCount}/{currentMagazine.MaxCount + weapon.ChamberAmmoCount}) </color>";
|
||||
}
|
||||
}
|
||||
if (Settings.playerWeapon)
|
||||
{
|
||||
if (text2 == string.Empty)
|
||||
{
|
||||
Render.DrawString(new Vector2(gamePlayer.ScreenPosition.x, gamePlayer.ScreenPosition.y + 6.5f), " " + gamePlayer.Player.HandsController.Item.ShortName.Localized() + " ", Settings.EnemyWeaponTextColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
Render.DrawString(new Vector2(gamePlayer.ScreenPosition.x, gamePlayer.ScreenPosition.y + 6.5f), " " + gamePlayer.Player.HandsController.Item.ShortName.Localized() + " " + text2, Settings.EnemyWeaponTextColor, centered: true, default(Color), outline: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Settings.PlayerInventoryESP)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num4 = -20;
|
||||
HashSet<string> hashSet = new HashSet<string>();
|
||||
if (!gamePlayer.ItemInit)
|
||||
{
|
||||
gamePlayer.RefreshItems();
|
||||
}
|
||||
if (gamePlayer.LootItems == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
foreach (ContainerItem lootItem in gamePlayer.LootItems)
|
||||
{
|
||||
string localizedName = lootItem.LocalizedName;
|
||||
_ = lootItem.ItemID;
|
||||
if (GameUtils.ShouldDisplayItem(lootItem) && !hashSet.Contains(localizedName))
|
||||
{
|
||||
Color itemColor = GameUtils.GetItemColor(lootItem.Itemcat);
|
||||
string text3 = ((lootItem.Count > 1) ? $" ({lootItem.Count}) " : "");
|
||||
string text4 = (Settings.drawvalue ? $"[{lootItem.itemprice / 1000}K] " : "");
|
||||
Render.DrawString(new Vector2(gamePlayer.ScreenPosition.x, gamePlayer.ScreenPosition.y - (float)num4), "Has: " + lootItem.ShortName + text3 + text4 + ". ", itemColor);
|
||||
hashSet.Add(localizedName);
|
||||
num4 -= 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Chams()
|
||||
{
|
||||
if (Main.GameWorld == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
if (gamePlayer.Distance > Settings.DrawPlayersDistance || gamePlayer.Player == Main.LocalPlayer || !Settings.Chams)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Renderer[] componentsInChildren = gamePlayer.Player.GetComponentsInChildren<Renderer>();
|
||||
bool flag = false;
|
||||
Renderer[] array = componentsInChildren;
|
||||
foreach (Renderer renderer in array)
|
||||
{
|
||||
if (renderer == null || renderer.material == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!originalShaders.ContainsKey(renderer))
|
||||
{
|
||||
originalShaders[renderer] = renderer.material.shader;
|
||||
}
|
||||
Color playerChamsVisible = Settings.PlayerChamsVisible;
|
||||
Color playerChamsHidden = Settings.PlayerChamsHidden;
|
||||
if (previousChamsColors.ContainsKey(renderer))
|
||||
{
|
||||
(Color, Color) tuple = previousChamsColors[renderer];
|
||||
if (tuple.Item1 == playerChamsVisible && tuple.Item2 == playerChamsHidden)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
Shader shader = Main.bundle.LoadAsset<Shader>("wireframe.shader");
|
||||
if (!(shader == null))
|
||||
{
|
||||
renderer.material.shader = shader;
|
||||
renderer.material.SetColor("_VisibleColor", playerChamsVisible);
|
||||
renderer.material.SetColor("_InvisibleColor", playerChamsHidden);
|
||||
renderer.allowOcclusionWhenDynamic = false;
|
||||
renderer.forceRenderingOff = false;
|
||||
renderer.enabled = true;
|
||||
previousChamsColors[renderer] = (playerChamsVisible, playerChamsHidden);
|
||||
}
|
||||
}
|
||||
}
|
||||
processedEntities.Add(gamePlayer.Player.GetInstanceID());
|
||||
}
|
||||
if (Settings.Chams || !shouldresetandclearchams)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer2 in Main.GamePlayers)
|
||||
{
|
||||
ClearChams(gamePlayer2);
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearChams(GamePlayer gamePlayer)
|
||||
{
|
||||
Renderer[] componentsInChildren = gamePlayer.Player.GetComponentsInChildren<Renderer>();
|
||||
foreach (Renderer renderer in componentsInChildren)
|
||||
{
|
||||
if (!(renderer == null) && originalShaders.ContainsKey(renderer))
|
||||
{
|
||||
Shader shader = originalShaders[renderer];
|
||||
renderer.material.shader = shader;
|
||||
renderer.allowOcclusionWhenDynamic = true;
|
||||
renderer.forceRenderingOff = false;
|
||||
renderer.enabled = true;
|
||||
}
|
||||
}
|
||||
shouldresetandclearchams = true;
|
||||
processedEntities.Remove(gamePlayer.Player.GetInstanceID());
|
||||
}
|
||||
|
||||
public void DrawHealth(GamePlayer gamePlayer)
|
||||
{
|
||||
float num = gamePlayer.HeadScreenPosition.y - 10f;
|
||||
float num2 = Math.Abs(gamePlayer.HeadScreenPosition.y - gamePlayer.ScreenPosition.y) + 10f;
|
||||
float num3 = num2 * 0.65f;
|
||||
if (gamePlayer.Player.HealthController.IsAlive)
|
||||
{
|
||||
float current = gamePlayer.Player.HealthController.GetBodyPartHealth(EBodyPart.Common).Current;
|
||||
float maximum = gamePlayer.Player.HealthController.GetBodyPartHealth(EBodyPart.Common).Maximum;
|
||||
Math.Floor(current);
|
||||
Math.Floor(maximum);
|
||||
float num4 = GameUtils.Map(current, 0f, maximum, 0f, num2);
|
||||
Color color = ((current / maximum < 0.5f) ? Color.red : _healthColor);
|
||||
float x = gamePlayer.ScreenPosition.x - num3 / 2f - 3f;
|
||||
float num5 = num + num2;
|
||||
Render.DrawLine(new Vector2(x, num5 - num4), new Vector2(x, num5), 3f, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
170
stoopid.raw/stupid.solutions.Features.ESP/Radar.cs
Normal file
170
stoopid.raw/stupid.solutions.Features.ESP/Radar.cs
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EFT;
|
||||
using stupid.solutions.Data;
|
||||
using stupid.solutions.stupid.solutions.Data;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
internal class Radar : MonoBehaviour
|
||||
{
|
||||
private Dictionary<bool, string> SettingList = new Dictionary<bool, string>
|
||||
{
|
||||
{
|
||||
Settings.Godmode,
|
||||
"Godmode"
|
||||
},
|
||||
{
|
||||
Settings.Flyhack,
|
||||
"Flyhack"
|
||||
},
|
||||
{
|
||||
Settings.Speedhack,
|
||||
"Speedhack"
|
||||
},
|
||||
{
|
||||
Settings.MagicBullet,
|
||||
"Magic Bullet"
|
||||
}
|
||||
};
|
||||
|
||||
private void Update()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Main.GameWorld != null)
|
||||
{
|
||||
_ = Settings.DrawRadar;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Settings.DrawRadar || !Menu2.showmenu)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Render.BoxRect(new Rect(Settings.RadarX + Settings.RadarSize / 2f - 3f, Settings.RadarY + Settings.RadarSize / 2f - 3f, 6f, 6f), Color.white);
|
||||
Render.DrawCornerBox(new Vector2(Settings.RadarX + Settings.RadarSize / 2f, Settings.RadarY), Settings.RadarSize, Settings.RadarSize, Color.white, outline: true);
|
||||
Render.DrawRadarBackground(new Rect(Settings.RadarX, Settings.RadarY, Settings.RadarSize, Settings.RadarSize));
|
||||
int? num = Main.GameWorld.RegisteredPlayers.Count() - 1;
|
||||
string[] obj = new string[5] { " Entity Count : ", null, null, null, null };
|
||||
int? num2 = num;
|
||||
obj[1] = num2.ToString();
|
||||
obj[2] = " Radar Range : ";
|
||||
obj[3] = ((int)Settings.DrawPlayersRadarDistance).ToString();
|
||||
obj[4] = "m ";
|
||||
string label = string.Concat(obj);
|
||||
Vector2 position = new Vector2(Settings.RadarX - 5f, Settings.RadarY - 20f);
|
||||
if (Main.GameWorld != null)
|
||||
{
|
||||
Render.DrawTextRadar(position, label, Color.white, centered: false);
|
||||
}
|
||||
if (Main.OnlineGamePlayers.Count > 0)
|
||||
{
|
||||
foreach (OnlineGamePlayer onlineGamePlayer in Main.OnlineGamePlayers)
|
||||
{
|
||||
if (onlineGamePlayer.Distance < Settings.DrawPlayersRadarDistance)
|
||||
{
|
||||
float y = Main.LocalPlayer.Transform.position.x - onlineGamePlayer.Player.Transform.position.x;
|
||||
float x = Main.LocalPlayer.Transform.position.z - onlineGamePlayer.Player.Transform.position.z;
|
||||
float num3 = Mathf.Atan2(y, x) * 57.29578f - 270f - Main.LocalPlayer.Transform.eulerAngles.y;
|
||||
float num4 = onlineGamePlayer.Distance * Mathf.Cos(num3 * ((float)Math.PI / 180f));
|
||||
float num5 = onlineGamePlayer.Distance * Mathf.Sin(num3 * ((float)Math.PI / 180f));
|
||||
num4 = num4 * (Settings.RadarSize / Settings.RadarRange) / 2f;
|
||||
num5 = num5 * (Settings.RadarSize / Settings.RadarRange) / 2f;
|
||||
_ = Color.white;
|
||||
if (onlineGamePlayer.Distance <= Settings.RadarRange)
|
||||
{
|
||||
Color item = GameUtils.GetPlayerTextDetailsO(onlineGamePlayer).playerColor;
|
||||
float num6 = Settings.RadarX + Settings.RadarSize / 2f + num4;
|
||||
float num7 = Settings.RadarY + Settings.RadarSize / 2f + num5;
|
||||
Render.BoxRect(new Rect(num6 - 3f, num7 - 3f, 6f, 6f), item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
foreach (GamePlayer gamePlayer in Main.GamePlayers)
|
||||
{
|
||||
if (gamePlayer.Distance < Settings.DrawPlayersRadarDistance)
|
||||
{
|
||||
float y2 = Main.LocalPlayer.Transform.position.x - gamePlayer.Player.Transform.position.x;
|
||||
float x2 = Main.LocalPlayer.Transform.position.z - gamePlayer.Player.Transform.position.z;
|
||||
float num8 = Mathf.Atan2(y2, x2) * 57.29578f - 270f - Main.LocalPlayer.Transform.eulerAngles.y;
|
||||
float num9 = gamePlayer.Distance * Mathf.Cos(num8 * ((float)Math.PI / 180f));
|
||||
float num10 = gamePlayer.Distance * Mathf.Sin(num8 * ((float)Math.PI / 180f));
|
||||
num9 = num9 * (Settings.RadarSize / Settings.RadarRange) / 2f;
|
||||
num10 = num10 * (Settings.RadarSize / Settings.RadarRange) / 2f;
|
||||
Color white = Color.white;
|
||||
WildSpawnType role = gamePlayer.Player.Profile.Info.Settings.Role;
|
||||
if (gamePlayer.Distance <= Settings.RadarRange)
|
||||
{
|
||||
white = GameUtils.GetPlayerTextDetails(gamePlayer, role).playerColor;
|
||||
float num11 = Settings.RadarX + Settings.RadarSize / 2f + num9;
|
||||
float num12 = Settings.RadarY + Settings.RadarSize / 2f + num10;
|
||||
Render.BoxRect(new Rect(num11 - 3f, num12 - 3f, 6f, 6f), white);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawActiveFeatures(bool setting, string settingName, ref int currentOffsetY)
|
||||
{
|
||||
string label = settingName + ": " + (setting ? "On" : "Off");
|
||||
Render.DrawTextRadar(new Vector2(Settings.RadarX - 5f - (float)currentOffsetY, Settings.RadarY - 20f), label, Color.white, centered: false);
|
||||
currentOffsetY += 20;
|
||||
}
|
||||
|
||||
private void DrawFeatures()
|
||||
{
|
||||
int currentOffsetY = 0;
|
||||
foreach (KeyValuePair<bool, string> setting in SettingList)
|
||||
{
|
||||
DrawActiveFeatures(setting.Key, setting.Value, ref currentOffsetY);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowAim(GamePlayer gamePlayer, float radarX, float radarY)
|
||||
{
|
||||
Vector3 vector = RayCast.BarrelRayCast(gamePlayer.Player);
|
||||
if (vector != Vector3.zero)
|
||||
{
|
||||
Vector3 position = gamePlayer.Player.Fireport.position;
|
||||
Vector3 normalized = (vector - position).normalized;
|
||||
float num = normalized.x * 15f;
|
||||
float num2 = normalized.y * 15f;
|
||||
float x = radarX + num;
|
||||
float y = radarY + num2;
|
||||
Render.DrawLine(new Vector3(radarX, radarY, 0f), new Vector3(x, y, 0f), 1f, Color.red);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowAimO(OnlineGamePlayer gamePlayer, float radarX, float radarY)
|
||||
{
|
||||
Vector3 vector = RayCast.BarrelRayCastO(gamePlayer);
|
||||
if (vector != Vector3.zero)
|
||||
{
|
||||
Vector3 position = gamePlayer.Player.ObservedPlayerController.HandsController.CurrentFireport.position;
|
||||
Vector3 normalized = (vector - position).normalized;
|
||||
float num = (0f - normalized.x) * 15f;
|
||||
float num2 = normalized.y * 15f;
|
||||
float x = radarX + num;
|
||||
float y = radarY + num2;
|
||||
Render.DrawLine(new Vector3(radarX, radarY, 0f), new Vector3(x, y, 0f), 1f, Color.red);
|
||||
}
|
||||
}
|
||||
}
|
||||
367
stoopid.raw/stupid.solutions.Features.ESP/TracerESP.cs
Normal file
367
stoopid.raw/stupid.solutions.Features.ESP/TracerESP.cs
Normal file
|
|
@ -0,0 +1,367 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using EFT.UI;
|
||||
using stupid.solutions.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace stupid.solutions.Features.ESP;
|
||||
|
||||
public class TracerESP : MonoBehaviour
|
||||
{
|
||||
private class HitMarker
|
||||
{
|
||||
public Vector3 position;
|
||||
|
||||
public float displayTime;
|
||||
|
||||
public float damage;
|
||||
|
||||
public Vector3 floatingOffset;
|
||||
|
||||
public bool isHeadshot;
|
||||
|
||||
public int playerId;
|
||||
|
||||
public HitMarker(Vector3 position, float displayTime, float damage, bool isHeadshot, int playerId)
|
||||
{
|
||||
this.position = position;
|
||||
this.displayTime = displayTime;
|
||||
this.damage = damage;
|
||||
floatingOffset = Vector3.zero;
|
||||
this.isHeadshot = isHeadshot;
|
||||
this.playerId = playerId;
|
||||
}
|
||||
}
|
||||
|
||||
private class Tracer
|
||||
{
|
||||
public List<Vector3> positions = new List<Vector3>();
|
||||
|
||||
public int fireIndex;
|
||||
|
||||
public int fragmentIndex;
|
||||
|
||||
public int randomSeed;
|
||||
|
||||
public float startTime;
|
||||
|
||||
public bool hitTarget;
|
||||
|
||||
public bool hitMarkerDrawn;
|
||||
|
||||
public Vector3? startPosition;
|
||||
|
||||
public bool startUsed;
|
||||
|
||||
public Tracer(int fireIndex, int fragmentIndex, int randomSeed, Vector3? startPosition = null)
|
||||
{
|
||||
this.fireIndex = fireIndex;
|
||||
this.fragmentIndex = fragmentIndex;
|
||||
this.randomSeed = randomSeed;
|
||||
this.startPosition = startPosition;
|
||||
startUsed = false;
|
||||
startTime = Time.time;
|
||||
hitTarget = false;
|
||||
hitMarkerDrawn = false;
|
||||
}
|
||||
|
||||
public void AddPosition(Vector3 position)
|
||||
{
|
||||
if (!hitTarget)
|
||||
{
|
||||
positions.Add(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool hitmarkerloaded;
|
||||
|
||||
private static Dictionary<int, Tracer> validProjectiles = new Dictionary<int, Tracer>();
|
||||
|
||||
private static List<HitMarker> activeHitMarkers = new List<HitMarker>();
|
||||
|
||||
private Dictionary<int, bool> playerAliveStatus = new Dictionary<int, bool>();
|
||||
|
||||
private static Dictionary<int, float> damageTimers = new Dictionary<int, float>();
|
||||
|
||||
private HashSet<int> blacklistedSeeds = new HashSet<int>();
|
||||
|
||||
private bool clearalivestatus;
|
||||
|
||||
private float hitMarkerDuration = 1f;
|
||||
|
||||
private static float hitMarkerVolume = 0.2f;
|
||||
|
||||
private float damageAccumulationTime = 0.5f;
|
||||
|
||||
private static Texture2D hitMarkerTexture;
|
||||
|
||||
private bool isReactionOnShotHooked;
|
||||
|
||||
public static TestHook ReactionOnShotHook;
|
||||
|
||||
private static MethodInfo originalMethod;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
ConsoleScreen.Log("Init GL material....");
|
||||
GameUtils.InitMaterial();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!Settings.tracers && !Settings.HitMarkers)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.GameWorld == null && clearalivestatus)
|
||||
{
|
||||
playerAliveStatus.Clear();
|
||||
clearalivestatus = false;
|
||||
}
|
||||
else if (Main.GameWorld != null && !clearalivestatus)
|
||||
{
|
||||
clearalivestatus = true;
|
||||
}
|
||||
if (Main.GameWorld == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!hitmarkerloaded && Main.bundle != null)
|
||||
{
|
||||
hitMarkerTexture = Main.bundle.LoadAsset<Texture2D>("hitmarkerImage");
|
||||
hitmarkerloaded = hitMarkerTexture != null;
|
||||
ConsoleScreen.Log((hitMarkerTexture != null) ? "Hitmarker image loaded successfully!" : "Failed to load hitmarker image!");
|
||||
}
|
||||
if (hitMarkerTexture == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.OnlineGamePlayers.Count > 0)
|
||||
{
|
||||
if (!isReactionOnShotHooked && Settings.HitMarkers)
|
||||
{
|
||||
isReactionOnShotHooked = true;
|
||||
}
|
||||
_F163 obj = Main.GameWorld?.ClientBallisticCalculator;
|
||||
int activeShotsCount = obj.ActiveShotsCount;
|
||||
if (obj == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < activeShotsCount; i++)
|
||||
{
|
||||
_F16A activeShot = obj.GetActiveShot(i);
|
||||
if (activeShot == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (activeShot.PlayerProfileID == Main.LocalPlayer.ProfileId && !validProjectiles.ContainsKey(activeShot.RandomSeed))
|
||||
{
|
||||
Tracer value = new Tracer(activeShot.FireIndex, activeShot.FragmentIndex, activeShot.RandomSeed, activeShot.StartPosition);
|
||||
validProjectiles[activeShot.RandomSeed] = value;
|
||||
}
|
||||
if (validProjectiles.ContainsKey(activeShot.RandomSeed))
|
||||
{
|
||||
Tracer tracer = validProjectiles[activeShot.RandomSeed];
|
||||
if (tracer.startPosition.HasValue && !tracer.startUsed)
|
||||
{
|
||||
tracer.positions.Add(tracer.startPosition.Value);
|
||||
tracer.startUsed = true;
|
||||
}
|
||||
tracer.AddPosition(activeShot.CurrentPosition);
|
||||
}
|
||||
}
|
||||
activeHitMarkers.RemoveAll((HitMarker marker) => Time.time - marker.displayTime > hitMarkerDuration);
|
||||
validProjectiles = validProjectiles.Where((KeyValuePair<int, Tracer> keyValuePair) => Time.time - keyValuePair.Value.startTime < 5f).ToDictionary((KeyValuePair<int, Tracer> keyValuePair) => keyValuePair.Key, (KeyValuePair<int, Tracer> keyValuePair) => keyValuePair.Value);
|
||||
return;
|
||||
}
|
||||
_F163 obj2 = Main.GameWorld?.SharedBallisticsCalculator;
|
||||
int activeShotsCount2 = obj2.ActiveShotsCount;
|
||||
if (obj2 == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int num = 0; num < activeShotsCount2; num++)
|
||||
{
|
||||
_F16A activeShot2 = obj2.GetActiveShot(num);
|
||||
if (activeShot2 == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (activeShot2.PlayerProfileID == Main.LocalPlayer.ProfileId && !validProjectiles.ContainsKey(activeShot2.RandomSeed))
|
||||
{
|
||||
Tracer value2 = new Tracer(activeShot2.FireIndex, activeShot2.FragmentIndex, activeShot2.RandomSeed, activeShot2.StartPosition);
|
||||
validProjectiles[activeShot2.RandomSeed] = value2;
|
||||
}
|
||||
if (!validProjectiles.ContainsKey(activeShot2.RandomSeed))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Tracer tracer2 = validProjectiles[activeShot2.RandomSeed];
|
||||
if (tracer2.startPosition.HasValue && !tracer2.startUsed)
|
||||
{
|
||||
tracer2.positions.Add(tracer2.startPosition.Value);
|
||||
tracer2.startUsed = true;
|
||||
}
|
||||
tracer2.AddPosition(activeShot2.CurrentPosition);
|
||||
if (Main.OnlineGamePlayers.Count >= 1 || !activeShot2.HasAchievedTarget || tracer2.hitMarkerDrawn)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
tracer2.hitTarget = true;
|
||||
tracer2.hitMarkerDrawn = true;
|
||||
if (!(activeShot2.HittedBallisticCollider is BodyPartCollider { Player: var player } bodyPartCollider))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bool flag = bodyPartCollider.BodyPartType == EBodyPart.Head;
|
||||
if (player == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int playerId = player.ProfileId.GetHashCode();
|
||||
if (playerAliveStatus.ContainsKey(playerId) && !playerAliveStatus[playerId])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
float current = player.HealthController.GetBodyPartHealth(EBodyPart.Common).Current;
|
||||
float num2 = player.HealthController.GetBodyPartHealth(EBodyPart.Common).Maximum - current;
|
||||
if (damageTimers.ContainsKey(playerId) && Time.time - damageTimers[playerId] < damageAccumulationTime)
|
||||
{
|
||||
HitMarker hitMarker = activeHitMarkers.FirstOrDefault((HitMarker m) => m.playerId == playerId);
|
||||
if (hitMarker != null)
|
||||
{
|
||||
hitMarker.damage += num2;
|
||||
hitMarker.displayTime = Time.time;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
activeHitMarkers.Add(new HitMarker(activeShot2.HitPoint, Time.time, num2, flag, playerId));
|
||||
damageTimers[playerId] = Time.time;
|
||||
}
|
||||
if (Settings.HitMarkers)
|
||||
{
|
||||
if (flag && Main.headshotsound != null)
|
||||
{
|
||||
Main.audioSourcehit.clip = Main.headshotsound;
|
||||
Main.audioSourcehit.volume = hitMarkerVolume;
|
||||
Main.audioSourcehit.Play();
|
||||
}
|
||||
else if (Main.hitMarkerSound != null)
|
||||
{
|
||||
Main.audioSourcehit.clip = Main.hitMarkerSound;
|
||||
Main.audioSourcehit.volume = hitMarkerVolume;
|
||||
Main.audioSourcehit.Play();
|
||||
}
|
||||
}
|
||||
bool isAlive = player.HealthController.IsAlive;
|
||||
playerAliveStatus[playerId] = isAlive;
|
||||
if (!isAlive)
|
||||
{
|
||||
damageTimers.Remove(playerId);
|
||||
}
|
||||
}
|
||||
activeHitMarkers.RemoveAll((HitMarker marker) => Time.time - marker.displayTime > hitMarkerDuration);
|
||||
validProjectiles = validProjectiles.Where((KeyValuePair<int, Tracer> keyValuePair) => Time.time - keyValuePair.Value.startTime < 5f).ToDictionary((KeyValuePair<int, Tracer> keyValuePair) => keyValuePair.Key, (KeyValuePair<int, Tracer> keyValuePair) => keyValuePair.Value);
|
||||
}
|
||||
|
||||
private static void ProcessOnlineHitMarker(Vector3 hitPosition, bool isHeadshot)
|
||||
{
|
||||
Vector3 position = GameUtils.WorldPointToScreenPoint(hitPosition);
|
||||
ConsoleScreen.Log($"Drawing Hitmarker at : {hitPosition} Headshot ? {isHeadshot}");
|
||||
if (position.z > 0f)
|
||||
{
|
||||
DrawHitMarker(position, 32f, isHeadshot);
|
||||
}
|
||||
}
|
||||
|
||||
private void Tracers()
|
||||
{
|
||||
if (!Settings.tracers)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (GameUtils.DrawMaterial == null)
|
||||
{
|
||||
GameUtils.InitMaterial();
|
||||
}
|
||||
Camera mainCamera = Main.MainCamera;
|
||||
if (mainCamera == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
GameUtils.DrawMaterial.SetPass(0);
|
||||
GL.PushMatrix();
|
||||
GL.LoadProjectionMatrix(mainCamera.projectionMatrix);
|
||||
GL.modelview = mainCamera.worldToCameraMatrix;
|
||||
GL.Begin(1);
|
||||
foreach (Tracer value in validProjectiles.Values)
|
||||
{
|
||||
if (value.positions.Count >= 1)
|
||||
{
|
||||
for (int i = 0; i < value.positions.Count - 1; i++)
|
||||
{
|
||||
Vector3 v = value.positions[i];
|
||||
Vector3 v2 = value.positions[i + 1];
|
||||
GL.Color(Settings.TracerColor);
|
||||
GL.Vertex(v);
|
||||
GL.Vertex(v2);
|
||||
}
|
||||
}
|
||||
}
|
||||
GL.End();
|
||||
GL.PopMatrix();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
Tracers();
|
||||
if (!Settings.HitMarkers)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (HitMarker activeHitMarker in activeHitMarkers)
|
||||
{
|
||||
Vector3 vector = GameUtils.WorldPointToScreenPoint(activeHitMarker.position);
|
||||
if (vector.z > 0f && vector.x >= 0f && vector.x <= (float)Screen.width && vector.y >= 0f && vector.y <= (float)Screen.height)
|
||||
{
|
||||
DrawDamageNumbers(activeHitMarker, vector);
|
||||
DrawHitMarker(vector, 32f, activeHitMarker.isHeadshot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawDamageNumbers(HitMarker hitMarker, Vector3 screenPosition)
|
||||
{
|
||||
hitMarker.floatingOffset.y += Time.deltaTime * 20f;
|
||||
Vector3 vector = screenPosition + hitMarker.floatingOffset;
|
||||
vector.y = (float)Screen.height - vector.y;
|
||||
if (hitMarker.isHeadshot)
|
||||
{
|
||||
string text = "HEADSHOT";
|
||||
GUI.color = new Color(1f, 0f, 0f, 1f);
|
||||
GUI.Label(new Rect(vector.x - 10f, vector.y - 40f, 100f, 20f), text);
|
||||
}
|
||||
string text2 = "";
|
||||
if (Main.GamePlayers.Count > 0)
|
||||
{
|
||||
text2 = "- " + hitMarker.damage.ToString("F0") + " hp ";
|
||||
}
|
||||
GUI.color = Settings.HitmarkerHeadShotColor;
|
||||
GUI.Label(new Rect(vector.x - 10f, vector.y - 20f, 100f, 20f), text2);
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
|
||||
private static void DrawHitMarker(Vector3 position, float size, bool isHeadshot)
|
||||
{
|
||||
if (!(hitMarkerTexture == null))
|
||||
{
|
||||
GUI.color = (isHeadshot ? Settings.HitmarkerHeadShotColor : Settings.HitmarkerHitColor);
|
||||
GUI.DrawTexture(new Rect(position.x - size / 2f, position.y - size / 2f, size, size), hitMarkerTexture);
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue