the initial commit to the repo.
This commit is contained in:
parent
025c032b8c
commit
1b757591b9
264 changed files with 21882 additions and 0 deletions
70
EscapeFromTarkovCheat/Features/ESP/LootableContainerESP.cs
Normal file
70
EscapeFromTarkovCheat/Features/ESP/LootableContainerESP.cs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
using EFT.Interactive;
|
||||
using EscapeFromTarkovCheat.Data;
|
||||
using EscapeFromTarkovCheat.Utils;
|
||||
using JsonType;
|
||||
using UnityEngine;
|
||||
|
||||
namespace EscapeFromTarkovCheat.Feauters.ESP
|
||||
{
|
||||
public class LootableContainerESP : MonoBehaviour
|
||||
{
|
||||
private static readonly float CacheLootItemsInterval = 100;
|
||||
private float _nextLootContainerCacheTime;
|
||||
private List<GameLootContainer> _gameLootContainers;
|
||||
private static readonly Color LootableContainerColor = new Color(1f, 0.2f, 0.09f);
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_gameLootContainers = new List<GameLootContainer>();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!Settings.DrawLootableContainers)
|
||||
return;
|
||||
|
||||
if (Time.time >= _nextLootContainerCacheTime)
|
||||
{
|
||||
if ((Main.GameWorld != null) && (Main.GameWorld.LootItems != null))
|
||||
{
|
||||
_gameLootContainers.Clear();
|
||||
|
||||
foreach (LootableContainer lootableContainer in FindObjectsOfType<LootableContainer>())
|
||||
{
|
||||
if (!GameUtils.IsLootableContainerValid(lootableContainer) || (Vector3.Distance(Main.MainCamera.transform.position, lootableContainer.transform.position) > Settings.DrawLootableContainersDistance))
|
||||
continue;
|
||||
|
||||
_gameLootContainers.Add(new GameLootContainer(lootableContainer));
|
||||
}
|
||||
_nextLootContainerCacheTime = (Time.time + CacheLootItemsInterval);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (GameLootContainer gameLootContainer in _gameLootContainers)
|
||||
gameLootContainer.RecalculateDynamics();
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (!Settings.DrawLootableContainers)
|
||||
return;
|
||||
|
||||
foreach (var gameLootContainer in _gameLootContainers)
|
||||
{
|
||||
if (!GameUtils.IsLootableContainerValid(gameLootContainer.LootableContainer) || !gameLootContainer.IsOnScreen || gameLootContainer.Distance > Settings.DrawLootableContainersDistance)
|
||||
continue;
|
||||
|
||||
//EFT.InventoryLogic.Item rootItem = gameLootContainer.LootableContainer.ItemOwner.RootItem;
|
||||
//rootItem.Template.Name.Localized();
|
||||
|
||||
string lootItemName = $"{gameLootContainer.LootableContainer.name} [{gameLootContainer.FormattedDistance}]";
|
||||
Render.DrawString(new Vector2(gameLootContainer.ScreenPosition.x - 50f, gameLootContainer.ScreenPosition.y), lootItemName, LootableContainerColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue