diff --git a/7DTD/Configs/Tiles.cs b/7DTD/Configs/Tiles.cs index 326518e..603f6f1 100644 --- a/7DTD/Configs/Tiles.cs +++ b/7DTD/Configs/Tiles.cs @@ -7,9 +7,11 @@ namespace Cheat.Configs { class Tiles - { + { + public bool Name = true; public bool Distance = true; public int MaxDistance = 300; + public bool[] TypeFilter = new bool[(Enum.GetNames(typeof(TileEntityType)).Length)]; } } diff --git a/7DTD/Esp/Tiles.cs b/7DTD/Esp/Tiles.cs index 648b137..58c9ba0 100644 --- a/7DTD/Esp/Tiles.cs +++ b/7DTD/Esp/Tiles.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Remoting; using System.Text; using System.Threading.Tasks; using UnityEngine; @@ -8,9 +9,10 @@ namespace Cheat.Esp { class Tiles : MonoBehaviour { - + private const string Identifier = "Tile Item Colour"; private float CacheTime; public static List TileList = new List(); + void Update() { try @@ -47,9 +49,9 @@ void OnGUI() if (GameManager.Instance.World == null) return; // check if world is active - + foreach (TileEntity tile in TileList) - { + { if (tile == null) continue; // check for valid pointer BlockEntityData blockentity = tile.GetChunk().GetBlockEntity(tile.ToWorldPos()); @@ -69,7 +71,18 @@ void OnGUI() if (distance > Globals.Config.Tiles.MaxDistance) continue; - Drawing.DrawString(new Vector2(screenposition.x, screenposition.y), $"{namestr}{distancestr}", Helpers.ColourHelper.GetColour("Tile Item Colour"), true, 12, FontStyle.Normal, 0); + + // It's Just TileEntityType Length Check Only + var tileTypes = Enum.GetNames(typeof(TileEntityType)); + for(int i = 0; i < tileTypes.Length; i++) + { + if (Globals.Config.Tiles.TypeFilter[i] && tileTypes[i] == tile.GetTileEntityType().ToStringCached()) + { + Drawing.DrawString(new Vector2(screenposition.x, screenposition.y), $"{namestr}{distancestr}", Helpers.ColourHelper.GetColour(Identifier), true, 12, FontStyle.Normal, 0); + } + } + + } } catch { } diff --git a/7DTD/Menu/Main.cs b/7DTD/Menu/Main.cs index 4ce6d88..e952d4d 100644 --- a/7DTD/Menu/Main.cs +++ b/7DTD/Menu/Main.cs @@ -141,9 +141,26 @@ void ESP() Toggle tiledistance = new Toggle("Tile Distance", "Shows Your Distance From The Tile", ref Globals.Config.Tiles.Distance); IntSlider tilemaxdistance = new IntSlider("Max Distance", "Max Distance Tiles Will Render", ref Globals.Config.Tiles.MaxDistance, 0, 2000, 50); + + + tiles.Items.Add(tilename); tiles.Items.Add(tiledistance); tiles.Items.Add(tilemaxdistance); + + + + SubMenu tileTypeFilterMenu = new SubMenu("Filter", "Tile Filter"); + tiles.Items.Add(tileTypeFilterMenu); + + System.Collections.IList filterType = Enum.GetValues(typeof(TileEntityType)); + for (int i = 0; i < filterType.Count; i++) + { + var type = (TileEntityType)filterType[i]; + Toggle tileTypeFilterToggle = new Toggle($"Tile Type Filter {type.ToStringCached()}", $"Filter : {type.ToStringCached()}", ref Globals.Config.Tiles.TypeFilter[i]); + tileTypeFilterMenu.Items.Add(tileTypeFilterToggle); + } + #endregion } #endregion