Decompiled source of PeakMod v0.4.0

plugins\PeakMod.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DearImGuiInjection;
using DearImGuiInjection.BepInEx;
using HarmonyLib;
using ImGuiNET;
using Peak;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using Zorro.Core;
using Zorro.Core.Serizalization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("PeakMod")]
[assembly: AssemblyDescription("PeakMod by TheLocalAdmin")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("TheLocalAdmin")]
[assembly: AssemblyProduct("PeakMod")]
[assembly: AssemblyCopyright("Copyright \ufffd 2026 TheLocalAdmin")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0e070e16-c355-4db0-804c-0510a5aa436e")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = "")]
[assembly: AssemblyVersion("0.1.1.0")]
public static class ConfigManager
{
	public static ManualLogSource Logger;

	public static ConfigEntry<bool> InfiniteStamina;

	public static ConfigEntry<bool> FlyMod;

	public static ConfigEntry<float> FlySpeed;

	public static ConfigEntry<float> FlyAcceleration;

	public static ConfigEntry<bool> LockStatus;

	public static ConfigEntry<bool> NoWeight;

	public static ConfigEntry<bool> NoEat;

	public static ConfigEntry<bool> NoInjury;

	public static ConfigEntry<bool> NoCold;

	public static ConfigEntry<bool> NoPoison;

	public static ConfigEntry<bool> NoHot;

	public static ConfigEntry<bool> NoCurse;

	public static ConfigEntry<bool> NoDrowsy;

	public static ConfigEntry<bool> NoSpores;

	public static ConfigEntry<bool> NoPetrify;

	public static ConfigEntry<bool> NoRagdoll;

	public static ConfigEntry<bool> UnlimitedItemUses;

	public static ConfigEntry<bool> SpeedMod;

	public static ConfigEntry<bool> JumpMod;

	public static ConfigEntry<bool> NoFallDmg;

	public static ConfigEntry<bool> ClimbMod;

	public static ConfigEntry<bool> VineClimbMod;

	public static ConfigEntry<bool> RopeClimbMod;

	public static ConfigEntry<float> SpeedAmount;

	public static ConfigEntry<float> JumpAmount;

	public static ConfigEntry<float> ClimbAmount;

	public static ConfigEntry<float> VineClimbAmount;

	public static ConfigEntry<float> RopeClimbAmount;

	public static ConfigEntry<float> RechargeAmountSlot1;

	public static ConfigEntry<float> RechargeAmountSlot2;

	public static ConfigEntry<float> RechargeAmountSlot3;

	public static ConfigEntry<bool> TeleportToPing;

	public static ConfigEntry<bool> ShowPlayerMarkers;

	public static ConfigEntry<bool> LuggageESP;

	public static ConfigEntry<string> LuggageESPColor;

	public static ConfigEntry<bool> ShowCoordOverlay;

	public static ConfigEntry<string> KeybindInfiniteStamina;

	public static ConfigEntry<string> KeybindFreezeAfflictions;

	public static ConfigEntry<string> KeybindNoWeight;

	public static ConfigEntry<string> KeybindUnlimitedItemUses;

	public static ConfigEntry<string> KeybindSpeedMod;

	public static ConfigEntry<string> KeybindJumpMod;

	public static ConfigEntry<string> KeybindClimbMod;

	public static ConfigEntry<string> KeybindVineClimbMod;

	public static ConfigEntry<string> KeybindRopeClimbMod;

	public static ConfigEntry<string> KeybindTeleportToPing;

	public static ConfigEntry<string> KeybindFlyMod;

	public static ConfigEntry<string> KeybindShowPlayerMarkers;

	public static ConfigEntry<string> KeybindShowCoordOverlay;

	public static void Init(ConfigFile config, ManualLogSource logger)
	{
		Logger = logger;
		Utilities.Logger = logger;
		InfiniteStamina = config.Bind<bool>("Cheats", "InfiniteStamina", false, (ConfigDescription)null);
		TeleportToPing = config.Bind<bool>("Cheats", "TeleportToPing", false, (ConfigDescription)null);
		FlyMod = config.Bind<bool>("Cheats", "Fly Mod", false, (ConfigDescription)null);
		FlySpeed = config.Bind<float>("Cheats", "Fly Speed", 100f, (ConfigDescription)null);
		FlyAcceleration = config.Bind<float>("Cheats", "Fly Acceleration", 300f, (ConfigDescription)null);
		LockStatus = config.Bind<bool>("Afflictions", "LockStatus", false, (ConfigDescription)null);
		NoWeight = config.Bind<bool>("Afflictions", "NoWeight", false, (ConfigDescription)null);
		NoEat = config.Bind<bool>("Afflictions", "NoEat", false, (ConfigDescription)null);
		NoInjury = config.Bind<bool>("Afflictions", "NoInjury", false, (ConfigDescription)null);
		NoCold = config.Bind<bool>("Afflictions", "NoCold", false, (ConfigDescription)null);
		NoPoison = config.Bind<bool>("Afflictions", "NoPoison", false, (ConfigDescription)null);
		NoHot = config.Bind<bool>("Afflictions", "NoHot", false, (ConfigDescription)null);
		NoCurse = config.Bind<bool>("Afflictions", "NoCurse", false, (ConfigDescription)null);
		NoDrowsy = config.Bind<bool>("Afflictions", "NoDrowsy", false, (ConfigDescription)null);
		NoSpores = config.Bind<bool>("Afflictions", "NoSpores", false, (ConfigDescription)null);
		NoPetrify = config.Bind<bool>("Afflictions", "NoPetrify", false, (ConfigDescription)null);
		NoRagdoll = config.Bind<bool>("Afflictions", "NoRagdoll", false, (ConfigDescription)null);
		UnlimitedItemUses = config.Bind<bool>("Cheats", "UnlimitedItemUses", false, (ConfigDescription)null);
		ShowPlayerMarkers = config.Bind<bool>("Cheats", "ShowPlayerMarkers", true, (ConfigDescription)null);
		LuggageESP = config.Bind<bool>("World", "LuggageESP", false, (ConfigDescription)null);
		LuggageESPColor = config.Bind<string>("World", "LuggageESPColor", "00FF00", (ConfigDescription)null);
		ShowCoordOverlay = config.Bind<bool>("UI", "ShowCoordOverlay", false, (ConfigDescription)null);
		KeybindInfiniteStamina = config.Bind<string>("Keybinds", "InfiniteStamina", "None", (ConfigDescription)null);
		KeybindFreezeAfflictions = config.Bind<string>("Keybinds", "FreezeAfflictions", "None", (ConfigDescription)null);
		KeybindNoWeight = config.Bind<string>("Keybinds", "NoWeight", "None", (ConfigDescription)null);
		KeybindUnlimitedItemUses = config.Bind<string>("Keybinds", "UnlimitedItemUses", "None", (ConfigDescription)null);
		KeybindSpeedMod = config.Bind<string>("Keybinds", "SpeedMod", "None", (ConfigDescription)null);
		KeybindJumpMod = config.Bind<string>("Keybinds", "JumpMod", "None", (ConfigDescription)null);
		KeybindClimbMod = config.Bind<string>("Keybinds", "ClimbMod", "None", (ConfigDescription)null);
		KeybindVineClimbMod = config.Bind<string>("Keybinds", "VineClimbMod", "None", (ConfigDescription)null);
		KeybindRopeClimbMod = config.Bind<string>("Keybinds", "RopeClimbMod", "None", (ConfigDescription)null);
		KeybindTeleportToPing = config.Bind<string>("Keybinds", "TeleportToPing", "None", (ConfigDescription)null);
		KeybindFlyMod = config.Bind<string>("Keybinds", "FlyMod", "None", (ConfigDescription)null);
		KeybindShowPlayerMarkers = config.Bind<string>("Keybinds", "ShowPlayerMarkers", "None", (ConfigDescription)null);
		KeybindShowCoordOverlay = config.Bind<string>("Keybinds", "ShowCoordOverlay", "None", (ConfigDescription)null);
		SpeedMod = config.Bind<bool>("Character", "SpeedMod", false, (ConfigDescription)null);
		JumpMod = config.Bind<bool>("Character", "JumpMod", false, (ConfigDescription)null);
		NoFallDmg = config.Bind<bool>("Character", "NoFallDmg", false, (ConfigDescription)null);
		ClimbMod = config.Bind<bool>("Character", "ClimbMod", false, (ConfigDescription)null);
		VineClimbMod = config.Bind<bool>("Character", "VineClimbMod", false, (ConfigDescription)null);
		RopeClimbMod = config.Bind<bool>("Character", "RopeClimbMod", false, (ConfigDescription)null);
		SpeedAmount = config.Bind<float>("Character", "SpeedAmount", 1f, (ConfigDescription)null);
		JumpAmount = config.Bind<float>("Character", "JumpAmount", 10f, (ConfigDescription)null);
		ClimbAmount = config.Bind<float>("Character", "ClimbAmount", 1f, (ConfigDescription)null);
		VineClimbAmount = config.Bind<float>("Character", "VineClimbAmount", 1f, (ConfigDescription)null);
		RopeClimbAmount = config.Bind<float>("Character", "RopeClimbAmount", 1f, (ConfigDescription)null);
		RechargeAmountSlot1 = config.Bind<float>("Inventory", "RechargeAmountSlot1", 100f, (ConfigDescription)null);
		RechargeAmountSlot2 = config.Bind<float>("Inventory", "RechargeAmountSlot2", 100f, (ConfigDescription)null);
		RechargeAmountSlot3 = config.Bind<float>("Inventory", "RechargeAmountSlot3", 100f, (ConfigDescription)null);
		Logger.LogInfo((object)"[PeakMod][ConfigManager] Config Loaded.");
	}
}
internal static class ConstantFields
{
	private static PropertyInfo infiniteStaminaProp;

	private static PropertyInfo statusLockProp;

	private static FieldInfo fallDamageTimeField;

	private static FieldInfo staminaField;

	private static FieldInfo movementModifierField;

	private static FieldInfo jumpGravityField;

	private static FieldInfo climbSpeedModField;

	private static FieldInfo vineClimbSpeedModField;

	private static FieldInfo ropeClimbSpeedModField;

	private static MethodInfo setStatusMethod;

	private static Array statusEnumValues;

	public static PropertyInfo GetInfiniteStaminaProperty()
	{
		if (infiniteStaminaProp == null)
		{
			infiniteStaminaProp = typeof(Character).GetProperty("infiniteStam", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return infiniteStaminaProp;
	}

	public static PropertyInfo GetStatusLockProperty()
	{
		if (statusLockProp == null)
		{
			statusLockProp = typeof(Character).GetProperty("statusesLocked", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return statusLockProp;
	}

	public static FieldInfo GetFallDamageTimeField()
	{
		if (fallDamageTimeField == null)
		{
			fallDamageTimeField = typeof(CharacterMovement).GetField("fallDamageTime", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return fallDamageTimeField;
	}

	public static FieldInfo GetStaminaField()
	{
		if (staminaField == null)
		{
			staminaField = typeof(CharacterData).GetField("_stam", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return staminaField;
	}

	public static FieldInfo GetMovementModifierField()
	{
		if (movementModifierField == null)
		{
			movementModifierField = typeof(CharacterMovement).GetField("movementModifier", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return movementModifierField;
	}

	public static FieldInfo GetJumpGravityField()
	{
		if (jumpGravityField == null)
		{
			jumpGravityField = typeof(CharacterMovement).GetField("jumpGravity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return jumpGravityField;
	}

	public static FieldInfo GetClimbSpeedModField()
	{
		if (climbSpeedModField == null)
		{
			climbSpeedModField = typeof(CharacterClimbing).GetField("climbSpeedMod", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return climbSpeedModField;
	}

	public static FieldInfo GetVineClimbSpeedModField()
	{
		if (vineClimbSpeedModField == null)
		{
			vineClimbSpeedModField = typeof(CharacterVineClimbing).GetField("climbSpeedMod", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return vineClimbSpeedModField;
	}

	public static FieldInfo GetRopeClimbSpeedModField()
	{
		if (ropeClimbSpeedModField == null)
		{
			ropeClimbSpeedModField = typeof(CharacterRopeHandling).GetField("climbSpeedMod", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return ropeClimbSpeedModField;
	}

	public static MethodInfo GetSetStatusMethod()
	{
		if (setStatusMethod == null)
		{
			setStatusMethod = typeof(CharacterAfflictions).GetMethod("SetStatus", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}
		return setStatusMethod;
	}

	public static Array GetStatusEnumValues()
	{
		if (statusEnumValues == null)
		{
			statusEnumValues = Enum.GetValues(typeof(STATUSTYPE));
		}
		return statusEnumValues;
	}

	public static void RefreshAll()
	{
		infiniteStaminaProp = null;
		statusLockProp = null;
		fallDamageTimeField = null;
		staminaField = null;
		movementModifierField = null;
		jumpGravityField = null;
		climbSpeedModField = null;
		vineClimbSpeedModField = null;
		ropeClimbSpeedModField = null;
		setStatusMethod = null;
		statusEnumValues = null;
	}
}
public class EventComponent : MonoBehaviour
{
	private KeyCode? cachedInfiniteStamina;

	private KeyCode? cachedFreezeAfflictions;

	private KeyCode? cachedNoWeight;

	private KeyCode? cachedUnlimitedItemUses;

	private KeyCode? cachedSpeedMod;

	private KeyCode? cachedJumpMod;

	private KeyCode? cachedClimbMod;

	private KeyCode? cachedVineClimbMod;

	private KeyCode? cachedRopeClimbMod;

	private KeyCode? cachedTeleportToPing;

	private KeyCode? cachedFlyMod;

	private KeyCode? cachedShowPlayerMarkers;

	private KeyCode? cachedShowCoordOverlay;

	private string lastInfiniteStamina;

	private string lastFreezeAfflictions;

	private string lastNoWeight;

	private string lastUnlimitedItemUses;

	private string lastSpeedMod;

	private string lastJumpMod;

	private string lastClimbMod;

	private string lastVineClimbMod;

	private string lastRopeClimbMod;

	private string lastTeleportToPing;

	private string lastFlyMod;

	private string lastShowPlayerMarkers;

	private string lastShowCoordOverlay;

	private void Update()
	{
		CharacterMovement movementComponent = GameHelpers.GetMovementComponent();
		if ((Object)(object)movementComponent != (Object)null)
		{
			if (ConfigManager.SpeedMod.Value)
			{
				ConstantFields.GetMovementModifierField()?.SetValue(movementComponent, ConfigManager.SpeedAmount.Value);
			}
			if (ConfigManager.JumpMod.Value)
			{
				ConstantFields.GetJumpGravityField()?.SetValue(movementComponent, ConfigManager.JumpAmount.Value);
				if (ConfigManager.NoFallDmg.Value)
				{
					ConstantFields.GetFallDamageTimeField()?.SetValue(movementComponent, 999f);
				}
			}
		}
		Character characterComponent = GameHelpers.GetCharacterComponent();
		if ((Object)(object)characterComponent != (Object)null)
		{
			if (ConfigManager.InfiniteStamina.Value)
			{
				ConstantFields.GetInfiniteStaminaProperty()?.SetValue(characterComponent, true);
			}
			if (ConfigManager.LockStatus.Value)
			{
				ConstantFields.GetStatusLockProperty()?.SetValue(characterComponent, true);
			}
		}
		CharacterClimbing climbingComponent = GameHelpers.GetClimbingComponent();
		if ((Object)(object)climbingComponent != (Object)null && ConfigManager.ClimbMod.Value)
		{
			ConstantFields.GetClimbSpeedModField()?.SetValue(climbingComponent, ConfigManager.ClimbAmount.Value);
		}
		CharacterVineClimbing vineClimbComponent = GameHelpers.GetVineClimbComponent();
		if ((Object)(object)vineClimbComponent != (Object)null && ConfigManager.VineClimbMod.Value)
		{
			ConstantFields.GetVineClimbSpeedModField()?.SetValue(vineClimbComponent, ConfigManager.VineClimbAmount.Value);
		}
		CharacterRopeHandling ropeClimbComponent = GameHelpers.GetRopeClimbComponent();
		if ((Object)(object)ropeClimbComponent != (Object)null && ConfigManager.RopeClimbMod.Value)
		{
			ConstantFields.GetRopeClimbSpeedModField()?.SetValue(ropeClimbComponent, ConfigManager.RopeClimbAmount.Value);
		}
		HandleKeybinds();
	}

	private void HandleKeybinds()
	{
		ToggleKeybind(ConfigManager.KeybindInfiniteStamina, ConfigManager.InfiniteStamina, ref cachedInfiniteStamina, ref lastInfiniteStamina);
		ToggleKeybind(ConfigManager.KeybindFreezeAfflictions, ConfigManager.LockStatus, ref cachedFreezeAfflictions, ref lastFreezeAfflictions);
		ToggleKeybind(ConfigManager.KeybindNoWeight, ConfigManager.NoWeight, ref cachedNoWeight, ref lastNoWeight);
		ToggleKeybind(ConfigManager.KeybindUnlimitedItemUses, ConfigManager.UnlimitedItemUses, ref cachedUnlimitedItemUses, ref lastUnlimitedItemUses);
		ToggleKeybind(ConfigManager.KeybindSpeedMod, ConfigManager.SpeedMod, ref cachedSpeedMod, ref lastSpeedMod);
		ToggleKeybind(ConfigManager.KeybindJumpMod, ConfigManager.JumpMod, ref cachedJumpMod, ref lastJumpMod);
		ToggleKeybind(ConfigManager.KeybindClimbMod, ConfigManager.ClimbMod, ref cachedClimbMod, ref lastClimbMod);
		ToggleKeybind(ConfigManager.KeybindVineClimbMod, ConfigManager.VineClimbMod, ref cachedVineClimbMod, ref lastVineClimbMod);
		ToggleKeybind(ConfigManager.KeybindRopeClimbMod, ConfigManager.RopeClimbMod, ref cachedRopeClimbMod, ref lastRopeClimbMod);
		ToggleKeybind(ConfigManager.KeybindTeleportToPing, ConfigManager.TeleportToPing, ref cachedTeleportToPing, ref lastTeleportToPing);
		ToggleKeybind(ConfigManager.KeybindFlyMod, ConfigManager.FlyMod, ref cachedFlyMod, ref lastFlyMod);
		ToggleKeybind(ConfigManager.KeybindShowPlayerMarkers, ConfigManager.ShowPlayerMarkers, ref cachedShowPlayerMarkers, ref lastShowPlayerMarkers);
		ToggleKeybind(ConfigManager.KeybindShowCoordOverlay, ConfigManager.ShowCoordOverlay, ref cachedShowCoordOverlay, ref lastShowCoordOverlay);
	}

	private void ToggleKeybind(ConfigEntry<string> keybind, ConfigEntry<bool> toggle, ref KeyCode? cachedKey, ref string lastValue)
	{
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		if (keybind.Value != lastValue)
		{
			lastValue = keybind.Value;
			KeyCode result;
			if (string.IsNullOrEmpty(keybind.Value) || keybind.Value == "None")
			{
				cachedKey = null;
			}
			else if (Enum.TryParse<KeyCode>(keybind.Value, ignoreCase: true, out result))
			{
				cachedKey = result;
			}
			else
			{
				cachedKey = null;
			}
		}
		if (cachedKey.HasValue && Input.GetKeyDown(cachedKey.Value))
		{
			toggle.Value = !toggle.Value;
		}
	}
}
internal static class GameHelpers
{
	private static Character character;

	private static CharacterData characterData;

	private static CharacterMovement movementComponent;

	private static CharacterAfflictions afflictionsComponent;

	private static CharacterClimbing climbingComponent;

	private static CharacterVineClimbing vineClimbingComponent;

	private static CharacterRopeHandling ropeClimbingComponent;

	public static Character GetCharacterComponent()
	{
		if ((Object)(object)character == (Object)null || !((Behaviour)character).isActiveAndEnabled)
		{
			character = Character.localCharacter;
		}
		return character;
	}

	public static CharacterData GetCharacterData()
	{
		if ((Object)(object)characterData == (Object)null || !((Behaviour)characterData).isActiveAndEnabled)
		{
			characterData = Object.FindFirstObjectByType<CharacterData>();
		}
		return characterData;
	}

	public static CharacterMovement GetMovementComponent()
	{
		if ((Object)(object)movementComponent == (Object)null || !((Behaviour)movementComponent).isActiveAndEnabled)
		{
			Character characterComponent = GetCharacterComponent();
			movementComponent = ((characterComponent != null) ? ((Component)characterComponent).GetComponent<CharacterMovement>() : null);
		}
		return movementComponent;
	}

	public static CharacterAfflictions GetAfflictionsComponent()
	{
		if ((Object)(object)afflictionsComponent == (Object)null || !((Behaviour)afflictionsComponent).isActiveAndEnabled)
		{
			Character characterComponent = GetCharacterComponent();
			afflictionsComponent = ((characterComponent != null) ? ((Component)characterComponent).GetComponent<CharacterAfflictions>() : null);
		}
		return afflictionsComponent;
	}

	public static CharacterClimbing GetClimbingComponent()
	{
		if ((Object)(object)climbingComponent == (Object)null || !((Behaviour)climbingComponent).isActiveAndEnabled)
		{
			Character characterComponent = GetCharacterComponent();
			climbingComponent = ((characterComponent != null) ? ((Component)characterComponent).GetComponent<CharacterClimbing>() : null);
		}
		return climbingComponent;
	}

	public static CharacterVineClimbing GetVineClimbComponent()
	{
		if ((Object)(object)vineClimbingComponent == (Object)null || !((Behaviour)vineClimbingComponent).isActiveAndEnabled)
		{
			Character characterComponent = GetCharacterComponent();
			vineClimbingComponent = ((characterComponent != null) ? ((Component)characterComponent).GetComponent<CharacterVineClimbing>() : null);
		}
		return vineClimbingComponent;
	}

	public static CharacterRopeHandling GetRopeClimbComponent()
	{
		if ((Object)(object)ropeClimbingComponent == (Object)null || !((Behaviour)ropeClimbingComponent).isActiveAndEnabled)
		{
			Character characterComponent = GetCharacterComponent();
			ropeClimbingComponent = ((characterComponent != null) ? ((Component)characterComponent).GetComponent<CharacterRopeHandling>() : null);
		}
		return ropeClimbingComponent;
	}

	public static void Refresh()
	{
		character = null;
		characterData = null;
		movementComponent = null;
		afflictionsComponent = null;
		climbingComponent = null;
		vineClimbingComponent = null;
		ropeClimbingComponent = null;
	}
}
public static class Globals
{
	public static bool anyAfflictionEnabled;

	public static Character character;

	public static CharacterData characterData;

	public static FieldInfo staminaField;

	public static PropertyInfo infiniteStamProp;

	public static FieldInfo sinceFallSlideField;

	public static FieldInfo sinceGroundedField;

	public static object movementComp;

	public static FieldInfo movementModifierField;

	public static FieldInfo jumpGravityField;

	public static FieldInfo fallDamageTimeField;

	public static object characterClimb;

	public static FieldInfo climbSpeedModifierField;

	public static object characterVineClimb;

	public static FieldInfo vineClimbSpeedModifierField;

	public static object characterRopeHandling;

	public static FieldInfo ropeClimbSpeedModifierField;

	public static object afflictionsObj;

	public static MethodInfo setStatusMethod;

	public static object weightEnumValue;

	public static object poisonEnumValue;

	public static object hotEnumValue;

	public static object coldEnumValue;

	public static object curseEnumValue;

	public static object injuryEnumValue;

	public static object drowsyEnumValue;

	public static object hungerEnumValue;

	public static List<Item> items = new List<Item>();

	public static List<string> itemNames = new List<string>();

	public static List<string> itemPrefabNames = new List<string>();

	public static int[] selectedItems = new int[3] { -1, -1, -1 };

	public static string[] itemDisplayNames = new string[3] { "None", "None", "None" };

	public static string[] itemSearchBuffers = new string[3];

	public static int selectedSpawnItem = -1;

	public static string spawnItemSearch = "";

	public static int selectedHostStatusIndex = -1;

	public static float hostStatusAmount = 0.2f;

	public static int hostRemoveSlot = 0;

	public static List<int> hostStatusTypes = new List<int>();

	public static List<string> hostStatusNames = new List<string>();

	public static Player playerObj;

	public static List<Character> allPlayers = new List<Character>();

	public static List<string> playerNames = new List<string>();

	public static int selectedPlayer = -1;

	public static bool excludeSelfFromAllActions = true;

	public static bool teleportToPingEnabled = false;

	public static float teleportX = 0f;

	public static float teleportY = 0f;

	public static float teleportZ = 0f;

	public static readonly Segment[] allSegments;

	public static readonly string[] segmentNames;

	public static int selectedSegmentIndex;

	public static int ascentLevel;

	public static List<ACHIEVEMENTTYPE> badges;

	public static List<string> badgeNames;

	public static string badgeSearch;

	public static int selectedLuggageIndex;

	public static List<string> luggageLabels;

	public static List<Luggage> luggageObject;

	public static List<Luggage> allOpenedLuggage;

	static Globals()
	{
		Segment[] array = new Segment[7];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		allSegments = (Segment[])(object)array;
		segmentNames = new string[7] { "Beach", "Tropics", "Alpine", "Caldera", "The Kiln", "Peak", "Void" };
		selectedSegmentIndex = 0;
		ascentLevel = 1;
		badges = new List<ACHIEVEMENTTYPE>();
		badgeNames = new List<string>();
		badgeSearch = "";
		selectedLuggageIndex = -1;
		luggageLabels = new List<string>();
		luggageObject = new List<Luggage>();
		allOpenedLuggage = new List<Luggage>();
	}
}
[HarmonyPatch(typeof(PointPinger), "ReceivePoint_Rpc")]
public class PointPingPatch
{
	private static void Postfix(Vector3 point, Vector3 hitNormal, PointPinger __instance)
	{
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (ConfigManager.TeleportToPing.Value)
			{
				Character character = __instance.character;
				object obj;
				if (character == null)
				{
					obj = null;
				}
				else
				{
					PhotonView photonView = ((MonoBehaviourPun)character).photonView;
					obj = ((photonView != null) ? photonView.Owner : null);
				}
				Player val = (Player)obj;
				if (val != null && val == PhotonNetwork.LocalPlayer && (Object)(object)Character.localCharacter != (Object)null && !Character.localCharacter.data.dead)
				{
					Vector3 val2 = point + Vector3.up;
					((MonoBehaviourPun)Character.localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val2, true });
					ConfigManager.Logger.LogInfo((object)"[Patch] Teleported to ping!");
				}
			}
		}
		catch (Exception ex)
		{
			ConfigManager.Logger.LogError((object)("[Patch] Exception: " + ex));
		}
	}
}
[HarmonyPatch(typeof(Character), "Update")]
public class FlyPatch
{
	private static bool isFlying = false;

	private static Vector3 flyVelocity = Vector3.zero;

	public static bool IsFlying => isFlying;

	public static void SetFlying(bool enable)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		isFlying = enable;
		flyVelocity = Vector3.zero;
		ConfigManager.Logger.LogInfo((object)("[FlyMod] Flight " + (enable ? "enabled" : "disabled") + "."));
	}

	private static void Postfix(Character __instance)
	{
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		if (!__instance.IsLocal)
		{
			return;
		}
		if (!ConfigManager.FlyMod.Value)
		{
			if (isFlying)
			{
				isFlying = false;
				flyVelocity = Vector3.zero;
				ConfigManager.Logger.LogInfo((object)"[FlyMod] Flight disabled.");
			}
			return;
		}
		if (!isFlying)
		{
			isFlying = true;
			ConfigManager.Logger.LogInfo((object)"[FlyMod] Flight enabled.");
		}
		__instance.data.isGrounded = true;
		__instance.data.sinceGrounded = 0f;
		__instance.data.sinceJump = 0f;
		Vector3 val = Vector2.op_Implicit(__instance.input.movementInput);
		Vector3 normalized = ((Vector3)(ref __instance.data.lookDirection_Flat)).normalized;
		Vector3 val2 = Vector3.Cross(Vector3.up, normalized);
		Vector3 normalized2 = ((Vector3)(ref val2)).normalized;
		Vector3 val3 = normalized * val.y + normalized2 * val.x;
		if (__instance.input.jumpIsPressed)
		{
			val3 += Vector3.up;
		}
		if (__instance.input.crouchIsPressed)
		{
			val3 += Vector3.down;
		}
		float value = ConfigManager.FlySpeed.Value;
		float value2 = ConfigManager.FlyAcceleration.Value;
		flyVelocity = Vector3.Lerp(flyVelocity, ((Vector3)(ref val3)).normalized * value, Time.deltaTime * value2);
		foreach (Bodypart part in __instance.refs.ragdoll.partList)
		{
			if ((Object)(object)((part != null) ? part.Rig : null) != (Object)null)
			{
				part.Rig.linearVelocity = flyVelocity;
			}
		}
	}
}
[HarmonyPatch(typeof(CharacterAfflictions), "UpdateWeight")]
public class Patch_UpdateWeight
{
	private static void Postfix(CharacterAfflictions __instance)
	{
		if (ConfigManager.NoWeight.Value)
		{
			__instance.SetStatus((STATUSTYPE)7, 0f, true);
		}
	}
}
[HarmonyPatch(typeof(CharacterAfflictions), "Update")]
public class Patch_NoStatus
{
	private static void Postfix(CharacterAfflictions __instance)
	{
		if (!ConfigManager.LockStatus.Value)
		{
			if (ConfigManager.NoEat.Value)
			{
				__instance.SetStatus((STATUSTYPE)1, 0f, true);
			}
			if (ConfigManager.NoInjury.Value)
			{
				__instance.SetStatus((STATUSTYPE)0, 0f, true);
			}
			if (ConfigManager.NoCold.Value)
			{
				__instance.SetStatus((STATUSTYPE)2, 0f, true);
			}
			if (ConfigManager.NoPoison.Value)
			{
				__instance.SetStatus((STATUSTYPE)3, 0f, true);
			}
			if (ConfigManager.NoHot.Value)
			{
				__instance.SetStatus((STATUSTYPE)8, 0f, true);
			}
			if (ConfigManager.NoCurse.Value)
			{
				__instance.SetStatus((STATUSTYPE)5, 0f, true);
			}
			if (ConfigManager.NoDrowsy.Value)
			{
				__instance.SetStatus((STATUSTYPE)6, 0f, true);
			}
			if (ConfigManager.NoSpores.Value)
			{
				__instance.SetStatus((STATUSTYPE)10, 0f, true);
			}
			if (ConfigManager.NoPetrify.Value)
			{
				__instance.SetStatus((STATUSTYPE)13, 0f, true);
			}
		}
	}
}
[HarmonyPatch(typeof(CharacterData), "GetTargetRagdollControll")]
public class Patch_NoRagdoll
{
	private static bool Prefix(CharacterData __instance, ref float __result)
	{
		if (ConfigManager.NoRagdoll.Value && !__instance.dead)
		{
			Character component = ((Component)__instance).GetComponent<Character>();
			PhotonView val = ((component != null) ? ((MonoBehaviourPun)component).photonView : null);
			if ((Object)(object)val != (Object)null && val.IsMine)
			{
				__result = 1f;
				return false;
			}
		}
		return true;
	}
}
[HarmonyPatch(typeof(Action_ReduceUses), "ReduceUsesRPC")]
public class Patch_UnlimitedUses
{
	private static bool Prefix()
	{
		return !ConfigManager.UnlimitedItemUses.Value;
	}
}
[HarmonyPatch(typeof(Item), "CanUsePrimary")]
public class Patch_UnlimitedUsesPrimary
{
	private static bool Prefix(ref bool __result)
	{
		if (ConfigManager.UnlimitedItemUses.Value)
		{
			__result = true;
			return false;
		}
		return true;
	}
}
[HarmonyPatch(typeof(Item), "CanUseSecondary")]
public class Patch_UnlimitedUsesSecondary
{
	private static bool Prefix(ref bool __result)
	{
		if (ConfigManager.UnlimitedItemUses.Value)
		{
			__result = true;
			return false;
		}
		return true;
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.thelocaladmin.peakmod", "PeakMod V0.4.0 by TheLocalAdmin", "0.4.0")]
public class PeakMod : BaseUnityPlugin
{
	private bool styleApplied;

	private int selectedTab = 1;

	private void ApplyCustomStyle()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		ImGuiStylePtr style = ImGui.GetStyle();
		RangeAccessor<Vector4> colors = ((ImGuiStylePtr)(ref style)).Colors;
		Vector4 vector = new Vector4(0.04f, 0.04f, 0.04f, 1f);
		Vector4 vector2 = new Vector4(0.06f, 0.06f, 0.06f, 1f);
		Vector4 vector3 = new Vector4(0.09f, 0.09f, 0.09f, 1f);
		Vector4 vector4 = new Vector4(0.12f, 0.12f, 0.12f, 1f);
		Vector4 vector5 = new Vector4(0.17f, 0.17f, 0.17f, 1f);
		Vector4 vector6 = new Vector4(0.2f, 0.2f, 0.2f, 1f);
		Vector4 vector7 = new Vector4(0.92f, 0.92f, 0.92f, 1f);
		Vector4 vector8 = new Vector4(0.55f, 0.55f, 0.55f, 1f);
		Vector4 vector9 = new Vector4(0.93f, 0.62f, 0.06f, 1f);
		Vector4 vector10 = new Vector4(1f, 0.72f, 0.2f, 1f);
		Vector4 vector11 = new Vector4(0.75f, 0.48f, 0.03f, 1f);
		Vector4 vector12 = new Vector4(0.2f, 0.2f, 0.2f, 1f);
		colors[2] = vector2;
		colors[3] = vector3;
		colors[4] = vector4;
		colors[5] = vector12;
		colors[10] = vector;
		colors[11] = vector;
		colors[12] = vector;
		colors[0] = vector7;
		colors[1] = vector8;
		colors[18] = vector9;
		colors[7] = vector4;
		colors[8] = vector5;
		colors[9] = vector6;
		colors[44] = vector4;
		colors[45] = vector12;
		colors[46] = vector12;
		colors[47] = vector;
		colors[48] = vector2;
		colors[21] = vector4;
		colors[22] = vector9;
		colors[23] = vector11;
		colors[24] = vector4;
		colors[25] = vector5;
		colors[26] = vector6;
		colors[27] = vector12;
		colors[28] = vector9;
		colors[29] = vector10;
		colors[14] = vector;
		colors[15] = vector5;
		colors[16] = vector6;
		colors[17] = vector9;
		colors[19] = vector9;
		colors[20] = vector10;
		colors[51] = vector9;
		colors[49] = new Vector4(0.93f, 0.62f, 0.06f, 0.3f);
		((ImGuiStylePtr)(ref style)).WindowRounding = 6f;
		((ImGuiStylePtr)(ref style)).FrameRounding = 4f;
		((ImGuiStylePtr)(ref style)).ChildRounding = 4f;
		((ImGuiStylePtr)(ref style)).FrameBorderSize = 1f;
		((ImGuiStylePtr)(ref style)).GrabRounding = 4f;
		((ImGuiStylePtr)(ref style)).WindowPadding = new Vector2(6f, 6f);
		((ImGuiStylePtr)(ref style)).CellPadding = new Vector2(4f, 4f);
		((ImGuiStylePtr)(ref style)).ItemSpacing = new Vector2(4f, 4f);
		((ImGuiStylePtr)(ref style)).WindowBorderSize = 1f;
		((ImGuiStylePtr)(ref style)).PopupBorderSize = 1f;
	}

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PeakMod V0.4.0 by TheLocalAdmin - Mod Initialized");
		((Component)this).gameObject.AddComponent<EventComponent>();
	}

	private void OnEnable()
	{
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		((BaseUnityPlugin)this).Logger.LogInfo((object)"[PeakMod] OnEnable called");
		Globals.itemSearchBuffers = new string[3] { "", "", "" };
		ConfigManager.Init(((BaseUnityPlugin)this).Config, ((BaseUnityPlugin)this).Logger);
		DearImGuiInjection.Render += MyUI;
		DearImGuiInjection.Render += DrawPlayerMarkers;
		DearImGuiInjection.Render += DrawCoordOverlay;
		DearImGuiInjection.Render += DrawLuggageESP;
		new Harmony("com.thelocaladmin.peakmod").PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Harmony patches applied.");
	}

	private void OnDisable()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"[PeakMod] OnDisable called");
		DearImGuiInjection.Render -= MyUI;
		DearImGuiInjection.Render -= DrawPlayerMarkers;
		DearImGuiInjection.Render -= DrawCoordOverlay;
		DearImGuiInjection.Render -= DrawLuggageESP;
	}

	private void DrawPlayerMarkers()
	{
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!ConfigManager.ShowPlayerMarkers.Value)
			{
				return;
			}
			Camera main = Camera.main;
			if ((Object)(object)main == (Object)null)
			{
				return;
			}
			Character localCharacter = Character.localCharacter;
			if ((Object)(object)localCharacter == (Object)null)
			{
				return;
			}
			if (Globals.allPlayers.Count == 0)
			{
				Utilities.RefreshPlayerList();
			}
			ImDrawListPtr backgroundDrawList = ImGui.GetBackgroundDrawList();
			ImGuiIOPtr iO = ImGui.GetIO();
			Vector2 displaySize = ((ImGuiIOPtr)(ref iO)).DisplaySize;
			for (int i = 0; i < Globals.allPlayers.Count; i++)
			{
				Character val = Globals.allPlayers[i];
				if ((Object)(object)val == (Object)null || (Object)(object)val == (Object)(object)localCharacter || (Object)(object)val.Ghost != (Object)null)
				{
					continue;
				}
				Vector3 head;
				try
				{
					head = val.Head;
				}
				catch
				{
					continue;
				}
				Vector3 val2 = main.WorldToScreenPoint(head);
				if (!(val2.z < 0f))
				{
					float num = Vector3.Distance(localCharacter.Head, head);
					string arg = "Player";
					try
					{
						arg = val.characterName;
					}
					catch
					{
					}
					string text = $"{arg} - {num:F0}m";
					Vector2 vector = new Vector2(val2.x, displaySize.Y - val2.y);
					uint num2 = 4294095367u;
					Vector2 vector2 = ImGui.CalcTextSize(text);
					((ImDrawListPtr)(ref backgroundDrawList)).AddRectFilled(new Vector2(vector.X - 2f, vector.Y - 15f), new Vector2(vector.X + vector2.X + 4f, vector.Y + vector2.Y - 2f), 2684354560u);
					((ImDrawListPtr)(ref backgroundDrawList)).AddText(vector, num2, text);
				}
			}
		}
		catch (Exception ex)
		{
			ConfigManager.Logger.LogError((object)("[PeakMod] DrawPlayerMarkers Exception: " + ex));
		}
	}

	private void DrawCoordOverlay()
	{
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_0278: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!ConfigManager.ShowCoordOverlay.Value)
			{
				return;
			}
			Character localCharacter = Character.localCharacter;
			if ((Object)(object)localCharacter == (Object)null)
			{
				return;
			}
			ImDrawListPtr backgroundDrawList = ImGui.GetBackgroundDrawList();
			ImGuiIOPtr iO = ImGui.GetIO();
			_ = ref ((ImGuiIOPtr)(ref iO)).DisplaySize;
			float num = 10f;
			float num2 = 18f;
			uint num3 = 3221225472u;
			uint num4 = 4294095367u;
			uint num5 = 4278242559u;
			uint num6 = 4278255496u;
			Vector3 head = localCharacter.Head;
			string text = $"YOU: X={head.x:F1} Y={head.y:F1} Z={head.z:F1}";
			Vector2 vector = ImGui.CalcTextSize(text);
			((ImDrawListPtr)(ref backgroundDrawList)).AddRectFilled(new Vector2(10f, num - 2f), new Vector2(12f + vector.X + 8f, num + vector.Y + 2f), num3);
			((ImDrawListPtr)(ref backgroundDrawList)).AddText(new Vector2(14f, num), num4, text);
			num += num2;
			if (Globals.allPlayers.Count == 0)
			{
				Utilities.RefreshPlayerList();
			}
			for (int i = 0; i < Globals.allPlayers.Count; i++)
			{
				Character val = Globals.allPlayers[i];
				if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)localCharacter) && !((Object)(object)val.Ghost != (Object)null))
				{
					Vector3 head2;
					try
					{
						head2 = val.Head;
					}
					catch
					{
						continue;
					}
					string text2 = "Player";
					try
					{
						text2 = val.characterName;
					}
					catch
					{
					}
					float num7 = Vector3.Distance(head, head2);
					string text3 = $"{text2}: X={head2.x:F1} Y={head2.y:F1} Z={head2.z:F1} [{num7:F0}m]";
					vector = ImGui.CalcTextSize(text3);
					((ImDrawListPtr)(ref backgroundDrawList)).AddRectFilled(new Vector2(10f, num - 2f), new Vector2(12f + vector.X + 8f, num + vector.Y + 2f), num3);
					((ImDrawListPtr)(ref backgroundDrawList)).AddText(new Vector2(14f, num), num5, text3);
					num += num2;
				}
			}
			for (int j = 0; j < Globals.luggageObject.Count && j < 5; j++)
			{
				Luggage val2 = Globals.luggageObject[j];
				if (!((Object)(object)val2 == (Object)null))
				{
					Vector3 val3 = val2.Center();
					float num8 = Vector3.Distance(head, val3);
					string text4 = val2.displayName ?? "Container";
					string text5 = $"{text4}: X={val3.x:F1} Y={val3.y:F1} Z={val3.z:F1} [{num8:F0}m]";
					vector = ImGui.CalcTextSize(text5);
					((ImDrawListPtr)(ref backgroundDrawList)).AddRectFilled(new Vector2(10f, num - 2f), new Vector2(12f + vector.X + 8f, num + vector.Y + 2f), num3);
					((ImDrawListPtr)(ref backgroundDrawList)).AddText(new Vector2(14f, num), num6, text5);
					num += num2;
				}
			}
		}
		catch (Exception ex)
		{
			ConfigManager.Logger.LogError((object)("[PeakMod] DrawCoordOverlay Exception: " + ex));
		}
	}

	private void DrawLuggageESP()
	{
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!ConfigManager.LuggageESP.Value)
			{
				return;
			}
			Character localCharacter = Character.localCharacter;
			if ((Object)(object)localCharacter == (Object)null)
			{
				return;
			}
			Camera main = Camera.main;
			if ((Object)(object)main == (Object)null)
			{
				return;
			}
			Utilities.EnsureLuggageListInitialized();
			uint num = ParseHexColor(ConfigManager.LuggageESPColor.Value);
			ImDrawListPtr backgroundDrawList = ImGui.GetBackgroundDrawList();
			for (int i = 0; i < Globals.luggageObject.Count; i++)
			{
				Luggage val = Globals.luggageObject[i];
				if (!((Object)(object)val == (Object)null))
				{
					Vector3 val2 = val.Center();
					float num2 = Vector3.Distance(localCharacter.Head, val2);
					Vector3 val3 = main.WorldToScreenPoint(val2);
					if (!(val3.z < 0f))
					{
						ImGuiIOPtr iO = ImGui.GetIO();
						Vector2 displaySize = ((ImGuiIOPtr)(ref iO)).DisplaySize;
						float x = val3.x;
						float num3 = displaySize.Y - val3.y;
						float num4 = Mathf.Clamp(800f / num2, 8f, 60f);
						Vector2 vector = new Vector2(x - num4, num3 - num4);
						Vector2 vector2 = new Vector2(x + num4, num3 + num4);
						((ImDrawListPtr)(ref backgroundDrawList)).AddRect(vector, vector2, num, 0f, (ImDrawFlags)0, 2f);
						string arg = val.displayName ?? "Container";
						string text = $"{arg} [{num2:F0}m]";
						Vector2 vector3 = ImGui.CalcTextSize(text);
						Vector2 vector4 = new Vector2(x - vector3.X / 2f, vector.Y - vector3.Y - 2f);
						((ImDrawListPtr)(ref backgroundDrawList)).AddRectFilled(new Vector2(vector4.X - 2f, vector4.Y - 1f), new Vector2(vector4.X + vector3.X + 2f, vector4.Y + vector3.Y + 1f), 2684354560u);
						((ImDrawListPtr)(ref backgroundDrawList)).AddText(vector4, num, text);
					}
				}
			}
		}
		catch (Exception ex)
		{
			ConfigManager.Logger.LogError((object)("[PeakMod] DrawLuggageESP Exception: " + ex));
		}
	}

	private uint ParseHexColor(string hex)
	{
		try
		{
			hex = hex.Replace("#", "").Trim();
			if (hex.Length == 6)
			{
				byte b = byte.Parse(hex.Substring(0, 2), NumberStyles.HexNumber);
				byte b2 = byte.Parse(hex.Substring(2, 2), NumberStyles.HexNumber);
				byte b3 = byte.Parse(hex.Substring(4, 2), NumberStyles.HexNumber);
				return (uint)(-16777216 | (b << 16) | (b2 << 8) | b3);
			}
		}
		catch
		{
		}
		return 4278255360u;
	}

	private void DrawCheckbox(ConfigEntry<bool> config, string label, Action<bool> mainThreadAction = null)
	{
		bool value = config.Value;
		if (!ImGui.Checkbox(label, ref value))
		{
			return;
		}
		config.Value = value;
		((BaseUnityPlugin)this).Logger.LogInfo((object)("[Menu] " + label + " toggled to " + (value ? "ON" : "OFF")));
		if (mainThreadAction != null)
		{
			UnityMainThreadDispatcher.Enqueue((Action)delegate
			{
				mainThreadAction(value);
			});
		}
	}

	private void DrawSliderFloat(ConfigEntry<float> config, string label, float min, float max, string format = "%.2f")
	{
		float value = config.Value;
		if (ImGui.SliderFloat(label, ref value, min, max, format))
		{
			config.Value = value;
		}
	}

	private bool DrawSearchableCombo(string label, ref int selectedIndex, List<string> items, ref string searchBuffer)
	{
		bool result = false;
		string text = "Search##" + label;
		ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X - 4f);
		ImGui.InputText("##" + text, ref searchBuffer, 100u);
		ImGui.PopItemWidth();
		if (string.IsNullOrEmpty(searchBuffer) && !ImGui.IsItemActive())
		{
			Vector2 itemRectMin = ImGui.GetItemRectMin();
			ImGui.SameLine();
			ImGui.SetCursorScreenPos(itemRectMin + new Vector2(4f, 2f));
			ImGui.PushStyleColor((ImGuiCol)0, new Vector4(0.55f, 0.55f, 0.55f, 1f));
			ImGui.TextUnformatted("Search items...");
			ImGui.PopStyleColor();
		}
		if (ImGui.BeginCombo(label, (selectedIndex >= 0 && selectedIndex < items.Count) ? items[selectedIndex] : "None"))
		{
			for (int i = 0; i < items.Count; i++)
			{
				if (string.IsNullOrEmpty(searchBuffer) || items[i].ToLower().Contains(searchBuffer.ToLower()))
				{
					bool flag = selectedIndex == i;
					if (ImGui.Selectable($"{items[i]}##{i}", flag))
					{
						selectedIndex = i;
						result = true;
					}
					if (flag)
					{
						ImGui.SetItemDefaultFocus();
					}
				}
			}
			ImGui.EndCombo();
		}
		return result;
	}

	private void DrawToolTip(string text)
	{
		ImGui.SameLine();
		ImGui.TextDisabled("(?)");
		if (ImGui.IsItemHovered())
		{
			ImGui.PushStyleColor((ImGuiCol)4, new Vector4(0.12f, 0.12f, 0.12f, 1f));
			ImGui.PushStyleColor((ImGuiCol)0, new Vector4(0.92f, 0.92f, 0.92f, 1f));
			ImGui.PushStyleVar((ImGuiStyleVar)4, 1f);
			ImGui.BeginTooltip();
			ImGui.PushTextWrapPos(450f);
			ImGui.TextUnformatted(text);
			ImGui.PopTextWrapPos();
			ImGui.EndTooltip();
			ImGui.PopStyleVar();
			ImGui.PopStyleColor(2);
		}
	}

	private void MyUI()
	{
		//IL_152c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1531: Unknown result type (might be due to invalid IL or missing references)
		//IL_1543: Unknown result type (might be due to invalid IL or missing references)
		//IL_154a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1551: Unknown result type (might be due to invalid IL or missing references)
		//IL_190e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1913: Unknown result type (might be due to invalid IL or missing references)
		//IL_1915: Unknown result type (might be due to invalid IL or missing references)
		//IL_179e: Unknown result type (might be due to invalid IL or missing references)
		//IL_17a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_17aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_1979: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!DearImGuiInjection.IsCursorVisible)
			{
				return;
			}
			if (!styleApplied)
			{
				ApplyCustomStyle();
				styleApplied = true;
			}
			ImGui.SetNextWindowPos(new Vector2(20f, 20f), (ImGuiCond)2);
			ImGui.SetNextWindowSize(new Vector2(540f, 340f), (ImGuiCond)2);
			if (ImGui.Begin("PeakMod V0.4.0 by TheLocalAdmin##Main", (ImGuiWindowFlags)32))
			{
				ImGui.BeginChild("Sidebar", new Vector2(90f, 0f), true);
				ImGui.Dummy(new Vector2(4f, 2f));
				string[] array = new string[10] { "PLAYER", "ITEMS", "SPAWN", "LOBBY", "WORLD", "STAGES", "ACHIEVE", "HOST", "PROFILE", "ABOUT" };
				for (int i = 0; i < array.Length; i++)
				{
					bool flag = selectedTab == i + 1;
					string obj = array[i];
					Vector4 vector = (flag ? new Vector4(0.96f, 0.7f, 0.16f, 1f) : new Vector4(0.85f, 0.85f, 0.85f, 1f));
					ImGui.PushStyleColor((ImGuiCol)0, vector);
					float x = ImGui.CalcTextSize(obj).X;
					ImGui.SetCursorPosX((ImGui.GetContentRegionAvail().X - x) * 0.5f);
					if (ImGui.Selectable(obj, flag))
					{
						selectedTab = i + 1;
					}
					ImGui.PopStyleColor();
				}
				ImGui.EndChild();
				ImGui.SameLine();
				ImGui.BeginChild("MainArea");
				if (selectedTab == 1)
				{
					float num = ImGui.GetContentRegionAvail().X / 2f;
					ImGui.BeginChild("PlayerColumn", new Vector2(num, 0f), true);
					ImGui.Indent(4f);
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Self Mods##SelfMods", (ImGuiTreeNodeFlags)32))
					{
						DrawCheckbox(ConfigManager.InfiniteStamina, "Infinite Stamina", delegate(bool flag11)
						{
							Character characterComponent = GameHelpers.GetCharacterComponent();
							PropertyInfo infiniteStaminaProperty = ConstantFields.GetInfiniteStaminaProperty();
							if ((Object)(object)characterComponent != (Object)null && infiniteStaminaProperty != null)
							{
								infiniteStaminaProperty.SetValue(characterComponent, flag11);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Prevents stamina from decreasing, allowing unlimited sprinting and actions.");
						DrawCheckbox(ConfigManager.LockStatus, "Freeze Afflictions", delegate(bool flag11)
						{
							Character characterComponent = GameHelpers.GetCharacterComponent();
							PropertyInfo statusLockProperty = ConstantFields.GetStatusLockProperty();
							if ((Object)(object)characterComponent != (Object)null && statusLockProperty != null)
							{
								statusLockProperty.SetValue(characterComponent, flag11);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Prevents your statuses from changing.");
						DrawCheckbox(ConfigManager.NoWeight, "No Weight");
						ImGui.SameLine();
						DrawToolTip("Disables weight penalties from carried items and backpack.");
						DrawCheckbox(ConfigManager.UnlimitedItemUses, "Unlimited Item Uses");
						ImGui.SameLine();
						DrawToolTip("Items never run out of uses.");
						DrawCheckbox(ConfigManager.SpeedMod, "Change Speed", delegate
						{
							CharacterMovement movementComponent = GameHelpers.GetMovementComponent();
							FieldInfo movementModifierField = ConstantFields.GetMovementModifierField();
							if ((Object)(object)movementComponent != (Object)null && movementModifierField != null)
							{
								movementModifierField.SetValue(movementComponent, ConfigManager.SpeedAmount.Value);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Overrides your character's movement speed with a custom multiplier.");
						DrawCheckbox(ConfigManager.JumpMod, "Change Jump", delegate
						{
							CharacterMovement movementComponent = GameHelpers.GetMovementComponent();
							FieldInfo jumpGravityField = ConstantFields.GetJumpGravityField();
							FieldInfo fallDamageTimeField = ConstantFields.GetFallDamageTimeField();
							if ((Object)(object)movementComponent != (Object)null && jumpGravityField != null)
							{
								jumpGravityField.SetValue(movementComponent, ConfigManager.JumpAmount.Value);
							}
							if ((Object)(object)movementComponent != (Object)null && fallDamageTimeField != null)
							{
								fallDamageTimeField.SetValue(movementComponent, ConfigManager.NoFallDmg.Value ? 999f : 1.5f);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Modifies jump height, allowing higher or lower jumps depending on your settings.");
						DrawCheckbox(ConfigManager.ClimbMod, "Change Climb", delegate
						{
							CharacterClimbing climbingComponent = GameHelpers.GetClimbingComponent();
							FieldInfo climbSpeedModField = ConstantFields.GetClimbSpeedModField();
							if ((Object)(object)climbingComponent != (Object)null && climbSpeedModField != null)
							{
								climbSpeedModField.SetValue(climbingComponent, ConfigManager.ClimbAmount.Value);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Adjusts the speed at which you climb ladders and surfaces.");
						DrawCheckbox(ConfigManager.VineClimbMod, "Change Vine Climb", delegate
						{
							CharacterVineClimbing vineClimbComponent = GameHelpers.GetVineClimbComponent();
							FieldInfo vineClimbSpeedModField = ConstantFields.GetVineClimbSpeedModField();
							if ((Object)(object)vineClimbComponent != (Object)null && vineClimbSpeedModField != null)
							{
								vineClimbSpeedModField.SetValue(vineClimbComponent, ConfigManager.VineClimbAmount.Value);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Changes climbing speed specifically for vines.");
						DrawCheckbox(ConfigManager.RopeClimbMod, "Change Rope Climb", delegate
						{
							CharacterRopeHandling ropeClimbComponent = GameHelpers.GetRopeClimbComponent();
							FieldInfo ropeClimbSpeedModField = ConstantFields.GetRopeClimbSpeedModField();
							if ((Object)(object)ropeClimbComponent != (Object)null && ropeClimbSpeedModField != null)
							{
								ropeClimbSpeedModField.SetValue(ropeClimbComponent, ConfigManager.RopeClimbAmount.Value);
							}
						});
						ImGui.SameLine();
						DrawToolTip("Modifies climbing speed when using ropes or rope-based obstacles.");
						DrawCheckbox(ConfigManager.TeleportToPing, "Teleport to Ping");
						ImGui.SameLine();
						DrawToolTip("Teleports your character to the pinged location on the map.");
						DrawCheckbox(ConfigManager.FlyMod, "Fly Mode", FlyPatch.SetFlying);
						ImGui.SameLine();
						DrawToolTip("Allows free movement in all directions while ignoring gravity.");
						DrawCheckbox(ConfigManager.ShowPlayerMarkers, "Show Player Markers");
						ImGui.SameLine();
						DrawToolTip("Draws markers with the name and distance of every nearby player on your screen.");
						DrawCheckbox(ConfigManager.ShowCoordOverlay, "Show Coordinates");
						ImGui.SameLine();
						DrawToolTip("Shows your coordinates and all nearby players/containers on screen.");
					}
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					if (ImGui.CollapsingHeader("Statuses##PlayerStatus", (ImGuiTreeNodeFlags)32))
					{
						ImGui.Text("No Status:");
						DrawCheckbox(ConfigManager.NoEat, "No Eat");
						ImGui.SameLine();
						DrawToolTip("You never get hungry and don't need to eat.");
						DrawCheckbox(ConfigManager.NoInjury, "No Injury");
						DrawCheckbox(ConfigManager.NoCold, "No Cold");
						DrawCheckbox(ConfigManager.NoPoison, "No Poison");
						DrawCheckbox(ConfigManager.NoCurse, "No Curse");
						DrawCheckbox(ConfigManager.NoDrowsy, "No Drowsy");
						DrawCheckbox(ConfigManager.NoHot, "No Heat");
						DrawCheckbox(ConfigManager.NoSpores, "No Spores");
						DrawCheckbox(ConfigManager.NoPetrify, "No Petrify");
						DrawCheckbox(ConfigManager.NoRagdoll, "No Ragdoll");
						ImGui.SameLine();
						DrawToolTip("Prevents your character from falling over / going limp.");
					}
					ImGui.EndChild();
					ImGui.Unindent();
					ImGui.SameLine();
					ImGui.BeginChild("PlayerDetailsColumn", new Vector2(num - 10f, 0f), true);
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Details", (ImGuiTreeNodeFlags)32))
					{
						if (ConfigManager.JumpMod.Value)
						{
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawCheckbox(ConfigManager.NoFallDmg, "No Fall Dmg");
							DrawSliderFloat(ConfigManager.JumpAmount, "##jump_amt", 10f, 500f, "Jump Mult: %.2f");
						}
						if (ConfigManager.SpeedMod.Value)
						{
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(ConfigManager.SpeedAmount, "##speed_amt", 1f, 20f, "Move Speed: %.2f");
						}
						if (ConfigManager.ClimbMod.Value)
						{
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(ConfigManager.ClimbAmount, "##climb_amt", 1f, 20f, "Climb Speed: %.2f");
						}
						if (ConfigManager.VineClimbMod.Value)
						{
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(ConfigManager.VineClimbAmount, "##vine_climb_amt", 1f, 20f, "Vine Speed: %.2f");
						}
						if (ConfigManager.RopeClimbMod.Value)
						{
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(ConfigManager.RopeClimbAmount, "##rope_climb_amt", 1f, 20f, "Rope Speed: %.2f");
						}
						if (ConfigManager.FlyMod.Value)
						{
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(ConfigManager.FlySpeed, "##fly_speed", 10f, 100f, "Fly Speed: %.2f");
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(ConfigManager.FlyAcceleration, "##fly_acceleration", 10f, 300f, "Fly Acceleration: %.2f");
						}
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						ImGui.Dummy(new Vector2(4f, 2f));
						ImGui.Text("Self Effects");
						if (ImGui.Button("Trip Self"))
						{
							Utilities.TripSelf();
						}
						ImGui.SameLine();
						if (ImGui.Button("Bees Self"))
						{
							Utilities.AttackSelfWithBees();
						}
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						ImGui.Dummy(new Vector2(4f, 2f));
						ImGui.TextWrapped("Save your favorite settings in PROFILE tab.");
						ImGui.TextWrapped("Set custom keybinds in BepInEx/config/com.thelocaladmin.peakmod.cfg");
						ImGui.TextWrapped("Questions: See GitHub or Thunderstore for details.");
					}
					ImGui.Unindent();
					ImGui.EndChild();
				}
				else if (selectedTab == 2)
				{
					if (Globals.itemNames.Count == 0)
					{
						Utilities.UpdateItems();
					}
					List<(int, int)> list = new List<(int, int)>();
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					if (ImGui.BeginTable("InventorySlots", 3, (ImGuiTableFlags)1984))
					{
						ImGui.TableSetupColumn("Slot 1");
						ImGui.TableSetupColumn("Slot 2");
						ImGui.TableSetupColumn("Slot 3");
						ImGui.TableHeadersRow();
						ImGui.TableNextRow();
						for (int num2 = 0; num2 < 3; num2++)
						{
							ImGui.TableSetColumnIndex(num2);
							ImGui.PushID(num2);
							string text = "None";
							if (Player.localPlayer?.itemSlots != null && Player.localPlayer.itemSlots.Length > num2)
							{
								ItemSlot obj2 = Player.localPlayer.itemSlots[num2];
								if ((Object)(object)((obj2 != null) ? obj2.prefab : null) != (Object)null)
								{
									text = Player.localPlayer.itemSlots[num2].prefab.GetName();
								}
							}
							ImGui.Text($"Item {num2 + 1}:");
							ImGui.SameLine();
							ImGui.Text(text);
							ImGui.Spacing();
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							int selectedIndex = Globals.selectedItems[num2];
							if (DrawSearchableCombo($"##Combo{num2}", ref selectedIndex, Globals.itemNames, ref Globals.itemSearchBuffers[num2]))
							{
								Globals.selectedItems[num2] = selectedIndex;
								list.Add((num2, selectedIndex));
							}
							ImGui.SameLine();
							DrawToolTip("Search and assign any available item to this slot.");
							ImGui.Spacing();
							ConfigEntry<float> val = (ConfigEntry<float>)(num2 switch
							{
								0 => ConfigManager.RechargeAmountSlot1, 
								1 => ConfigManager.RechargeAmountSlot2, 
								2 => ConfigManager.RechargeAmountSlot3, 
								_ => ConfigManager.RechargeAmountSlot1, 
							});
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							DrawSliderFloat(val, $"##recharge_mount##{num2}", 0f, 100f, "Charge: %.1f");
							if (ImGui.Button($"Recharge##{num2}"))
							{
								Utilities.RechargeInventorySlot(num2, val.Value);
							}
							ImGui.SameLine();
							DrawToolTip("Set how much to recharge the item's charges when clicking 'Recharge'.");
							ImGui.PopID();
						}
						ImGui.EndTable();
					}
					foreach (var (slot, itemIndex) in list)
					{
						Utilities.AssignInventoryItem(slot, itemIndex);
					}
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.Button("Refresh Item List"))
					{
						Utilities.UpdateItems();
					}
					ImGui.SameLine();
					DrawToolTip("Reloads the list of available items in case something was missed or updated.");
					ImGui.Unindent();
				}
				else if (selectedTab == 3)
				{
					if (Globals.itemNames.Count == 0)
					{
						Utilities.UpdateItems();
					}
					if (Globals.allPlayers.Count == 0)
					{
						Utilities.RefreshPlayerList();
					}
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					if (ImGui.BeginCombo("Spawn Target", (Globals.selectedPlayer >= 0 && Globals.selectedPlayer < Globals.playerNames.Count) ? Globals.playerNames[Globals.selectedPlayer] : "None"))
					{
						for (int num3 = 0; num3 < Globals.playerNames.Count; num3++)
						{
							bool flag2 = Globals.selectedPlayer == num3;
							if (ImGui.Selectable(Globals.playerNames[num3], flag2))
							{
								Globals.selectedPlayer = num3;
							}
						}
						ImGui.EndCombo();
					}
					DrawToolTip("Whose hand the item will be spawned into. Works for any player as a non-host.");
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					if (ImGui.BeginCombo("Item to Spawn", (Globals.selectedSpawnItem >= 0 && Globals.selectedSpawnItem < Globals.itemNames.Count) ? Globals.itemNames[Globals.selectedSpawnItem] : "None"))
					{
						ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
						ImGui.InputText("##spawn_item_search", ref Globals.spawnItemSearch, 64u);
						for (int num4 = 0; num4 < Globals.itemNames.Count; num4++)
						{
							if (string.IsNullOrEmpty(Globals.spawnItemSearch) || Globals.itemNames[num4].IndexOf(Globals.spawnItemSearch, StringComparison.OrdinalIgnoreCase) >= 0)
							{
								bool flag3 = Globals.selectedSpawnItem == num4;
								if (ImGui.Selectable(Globals.itemNames[num4], flag3))
								{
									Globals.selectedSpawnItem = num4;
								}
							}
						}
						ImGui.EndCombo();
					}
					ImGui.Dummy(new Vector2(4f, 4f));
					if (ImGui.Button("Spawn In Own Hand"))
					{
						Utilities.SpawnItemInHand(Globals.selectedSpawnItem);
					}
					DrawToolTip("Spawns the selected item into YOUR hand (any client).");
					if (ImGui.Button("Spawn In Selected Hand"))
					{
						Utilities.SpawnItemInSelectedHand(Globals.selectedSpawnItem);
					}
					DrawToolTip("Spawns the selected item into the selected player's hand (any client).");
				}
				else if (selectedTab == 4)
				{
					float num5 = ImGui.GetContentRegionAvail().X / 2f;
					if (Globals.allPlayers.Count == 0)
					{
						Utilities.RefreshPlayerList();
					}
					ImGui.BeginChild("Lobby_PlayerList", new Vector2(num5, 0f), true);
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Lobby Players", (ImGuiTreeNodeFlags)32))
					{
						ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
						if (ImGui.BeginCombo("Select Player", (Globals.selectedPlayer >= 0 && Globals.selectedPlayer < Globals.playerNames.Count) ? Globals.playerNames[Globals.selectedPlayer] : "None"))
						{
							for (int num6 = 0; num6 < Globals.playerNames.Count; num6++)
							{
								bool flag4 = Globals.selectedPlayer == num6;
								if (ImGui.Selectable($"{Globals.playerNames[num6]}##{num6}", flag4))
								{
									Globals.selectedPlayer = num6;
								}
								if (flag4)
								{
									ImGui.SetItemDefaultFocus();
								}
							}
							ImGui.EndCombo();
						}
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						ImGui.Text("All Players");
						if (ImGui.Button("Revive All"))
						{
							Utilities.ReviveAllPlayers();
						}
						ImGui.SameLine();
						if (ImGui.Button("Kill All"))
						{
							Utilities.KillAllPlayers();
						}
						if (ImGui.Button("Bees All"))
						{
							Utilities.BeesAll();
						}
						ImGui.SameLine();
						if (ImGui.Button("Warp All To Me"))
						{
							Utilities.WarpAllPlayersToMe();
						}
						bool excludeSelfFromAllActions = Globals.excludeSelfFromAllActions;
						if (ImGui.Checkbox("Exclude Self from All Actions##AllActions", ref excludeSelfFromAllActions))
						{
							Globals.excludeSelfFromAllActions = excludeSelfFromAllActions;
						}
					}
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.Button("Refresh Players List"))
					{
						Utilities.RefreshPlayerList();
					}
					ImGui.SameLine();
					DrawToolTip("Manually reloads the list of players in case it wasn't updated automatically.");
					ImGui.Unindent();
					ImGui.EndChild();
					ImGui.SameLine();
					ImGui.BeginChild("Lobby_PlayerActions", new Vector2(num5 - 10f, 0f), true);
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(0f, 4f));
					if (ImGui.CollapsingHeader("Actions", (ImGuiTreeNodeFlags)32))
					{
						if (Globals.selectedPlayer >= 0 && Globals.selectedPlayer < Globals.allPlayers.Count)
						{
							if (ImGui.Button("Revive"))
							{
								Utilities.ReviveSelectedPlayer();
							}
							ImGui.SameLine();
							if (ImGui.Button("Kill"))
							{
								Utilities.KillSelectedPlayer();
							}
							if (ImGui.Button("Warp To"))
							{
								Utilities.WarpToSelectedPlayer();
							}
							ImGui.SameLine();
							if (ImGui.Button("Warp To Me"))
							{
								Utilities.WarpSelectedPlayerToMe();
							}
							ImGui.Dummy(new Vector2(4f, 2f));
							ImGui.Separator();
							ImGui.Text("Player Effects");
							if (ImGui.Button("Trip"))
							{
								Utilities.TripSelectedPlayer();
							}
							ImGui.SameLine();
							if (ImGui.Button("Knock Out"))
							{
								Utilities.PassOutSelectedPlayer();
							}
							ImGui.SameLine();
							if (ImGui.Button("Wake Up"))
							{
								Utilities.WakeUpSelectedPlayer();
							}
							if (ImGui.Button("Stick (Freeze)"))
							{
								Utilities.StickSelectedPlayer();
							}
							ImGui.SameLine();
							if (ImGui.Button("Unstick"))
							{
								Utilities.UnstickSelectedPlayer();
							}
							if (ImGui.Button("Attack with Bees"))
							{
								Utilities.AttackSelectedPlayerWithBees();
							}
							ImGui.Dummy(new Vector2(4f, 2f));
							ImGui.Separator();
							ImGui.Text("Special Actions");
							if (ImGui.Button("Spawn Scoutmaster"))
							{
								Utilities.SpawnScoutmasterForPlayer(Globals.selectedPlayer);
							}
							ImGui.SameLine();
							DrawToolTip("Spawns a Scoutmaster near the selected player. Only works for host. Forces aggro.");
						}
						else
						{
							ImGui.Text("No player selected.");
						}
					}
					ImGui.Dummy(new Vector2(4f, 2f));
					ImGui.Separator();
					if (ImGui.CollapsingHeader("Teleport Player to Coords##TeleportToCoords", (ImGuiTreeNodeFlags)32))
					{
						if (Globals.selectedPlayer >= 0 && Globals.selectedPlayer < Globals.allPlayers.Count)
						{
							ImGui.Text("Target: " + Globals.playerNames[Globals.selectedPlayer]);
							ImGui.InputFloat("X", ref Globals.teleportX);
							ImGui.InputFloat("Y", ref Globals.teleportY);
							ImGui.InputFloat("Z", ref Globals.teleportZ);
							if (ImGui.Button("Teleport Selected Player to Coords"))
							{
								((BaseUnityPlugin)this).Logger.LogInfo((object)$"[PeakMod] Teleporting {Globals.playerNames[Globals.selectedPlayer]} to X:{Globals.teleportX} Y:{Globals.teleportY} Z:{Globals.teleportZ}");
								Utilities.TeleportSelectedPlayerToCoords(Globals.teleportX, Globals.teleportY, Globals.teleportZ);
							}
							ImGui.SameLine();
							DrawToolTip("Teleports the selected player to the specified coordinates. Use coordinates from the coordinate overlay.");
							if (ImGui.Button("Teleport Me to Coords"))
							{
								((BaseUnityPlugin)this).Logger.LogInfo((object)$"[PeakMod] Self teleport to X:{Globals.teleportX} Y:{Globals.teleportY} Z:{Globals.teleportZ}");
								Utilities.TeleportToCoords(Globals.teleportX, Globals.teleportY, Globals.teleportZ);
							}
						}
						else
						{
							ImGui.Text("No player selected.");
							ImGui.TextWrapped("Select a player first to teleport them to specific coordinates.");
						}
					}
					ImGui.Unindent();
					ImGui.EndChild();
				}
				else if (selectedTab == 5)
				{
					float num7 = ImGui.GetContentRegionAvail().X / 2f;
					Utilities.EnsureLuggageListInitialized();
					ImGui.BeginChild("World_LuggageList", new Vector2(num7, 0f), true);
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Containers", (ImGuiTreeNodeFlags)32))
					{
						ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
						string text2 = ((Globals.selectedLuggageIndex >= 0 && Globals.selectedLuggageIndex < Globals.luggageLabels.Count) ? Globals.luggageLabels[Globals.selectedLuggageIndex] : "None");
						if (ImGui.BeginCombo("Select Container", text2))
						{
							if (Globals.luggageLabels.Count > 0)
							{
								for (int num8 = 0; num8 < Globals.luggageLabels.Count; num8++)
								{
									bool flag5 = Globals.selectedLuggageIndex == num8;
									if (ImGui.Selectable($"{Globals.luggageLabels[num8]}##{num8}", flag5))
									{
										Globals.selectedLuggageIndex = num8;
									}
									if (flag5)
									{
										ImGui.SetItemDefaultFocus();
									}
								}
							}
							else
							{
								ImGui.TextDisabled("No containers found.");
							}
							ImGui.EndCombo();
						}
						ImGui.Dummy(new Vector2(4f, 2f));
						if (ImGui.Button("Refresh Luggage List"))
						{
							Utilities.hasInitializedLuggageList = false;
							Utilities.RefreshLuggageList();
						}
						ImGui.SameLine();
						DrawToolTip("Reloads the list of luggage within 300m of your position.");
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						ImGui.Text("All Nearby Containers");
						if (ImGui.Button("Open All Nearby"))
						{
							Utilities.OpenAllNearbyLuggage();
						}
					}
					ImGui.Unindent();
					ImGui.EndChild();
					ImGui.SameLine();
					ImGui.BeginChild("World_LuggageActions", new Vector2(num7 - 10f, 0f), true);
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(0f, 4f));
					if (ImGui.CollapsingHeader("Actions", (ImGuiTreeNodeFlags)32))
					{
						if (Globals.selectedLuggageIndex >= 0 && Globals.selectedLuggageIndex < Globals.luggageLabels.Count)
						{
							string arg = Globals.luggageLabels[Globals.selectedLuggageIndex];
							if (ImGui.Button("Warp To Luggage"))
							{
								((BaseUnityPlugin)this).Logger.LogInfo((object)$"[PeakMod] Warp requested for index {Globals.selectedLuggageIndex} - {arg}");
								Vector3 val2 = Globals.luggageObject[Globals.selectedLuggageIndex].Center();
								val2.y += 1.5f;
								Utilities.TeleportToCoords(val2.x, val2.y, val2.z);
							}
							if (ImGui.Button("Open Luggage"))
							{
								Utilities.OpenLuggage(Globals.selectedLuggageIndex);
							}
						}
						else
						{
							ImGui.Text("No luggage selected.");
						}
					}
					if (ImGui.CollapsingHeader("Luggage ESP", (ImGuiTreeNodeFlags)32))
					{
						DrawCheckbox(ConfigManager.LuggageESP, "Show Luggage Boxes");
						ImGui.SameLine();
						DrawToolTip("Draws glowing boxes around all nearby luggage on your screen.");
						if (ConfigManager.LuggageESP.Value)
						{
							string value = ConfigManager.LuggageESPColor.Value;
							ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
							ImGui.InputText("Box Color (hex)", ref value, 6u);
							ConfigManager.LuggageESPColor.Value = value;
							DrawToolTip("RGB hex color for the ESP boxes (e.g. 00FF00 = green, FF0000 = red).");
						}
					}
					ImGui.Unindent();
					ImGui.EndChild();
				}
				else if (selectedTab == 6)
				{
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Jump to Stage", (ImGuiTreeNodeFlags)32))
					{
						ImGui.TextWrapped("Teleport the lobby to any mountain stage. Works from host; otherwise the host is asked to teleport everyone.");
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 20f);
						string text3 = ((Globals.selectedSegmentIndex >= 0 && Globals.selectedSegmentIndex < Globals.segmentNames.Length) ? Globals.segmentNames[Globals.selectedSegmentIndex] : "None");
						if (ImGui.BeginCombo("Select Stage", text3))
						{
							for (int num9 = 0; num9 < Globals.segmentNames.Length; num9++)
							{
								bool flag6 = Globals.selectedSegmentIndex == num9;
								if (ImGui.Selectable($"{Globals.segmentNames[num9]}##{num9}", flag6))
								{
									Globals.selectedSegmentIndex = num9;
								}
								if (flag6)
								{
									ImGui.SetItemDefaultFocus();
								}
							}
							ImGui.EndCombo();
						}
						ImGui.Dummy(new Vector2(4f, 4f));
						if (ImGui.Button("Jump to Selected Stage"))
						{
							Utilities.TeleportToSegment(Globals.selectedSegmentIndex);
						}
						ImGui.SameLine();
						DrawToolTip("Teleports all players (including you) to the selected mountain stage.");
						if (Globals.selectedSegmentIndex == 2 || Globals.selectedSegmentIndex == 5)
						{
							ImGui.PushStyleColor((ImGuiCol)0, new Vector4(1f, 0.75f, 0.15f, 1f));
							ImGui.TextWrapped("[!] NOTE: Alpine and Peak teleports drop you in the air near the spawn point. Turn on Fly Mode in the PLAYER tab if you get stuck.");
							ImGui.PopStyleColor();
						}
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						try
						{
							Segment currentSegmentNumber = MapHandler.CurrentSegmentNumber;
							ImGui.Text($"Current Stage: {currentSegmentNumber}");
						}
						catch
						{
							ImGui.Text("Current Stage: unknown");
						}
					}
					ImGui.Unindent();
				}
				else if (selectedTab == 7)
				{
					ImGui.BeginChild("BadgeListPanel", new Vector2(ImGui.GetContentRegionAvail().X, 0f), true);
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Badges##Achievements", (ImGuiTreeNodeFlags)32))
					{
						ImGui.TextWrapped("Search the badge list and unlock or remove them.");
						ImGui.Dummy(new Vector2(4f, 4f));
						if (Globals.badgeNames.Count == 0)
						{
							Utilities.RefreshBadges();
						}
						ImGui.Text("Search Badges");
						ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
						ImGui.InputText("##badge_search", ref Globals.badgeSearch, 100u);
						ImGui.SameLine();
						DrawToolTip("Type to filter the badge list.");
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.BeginChild("BadgeList", new Vector2(0f, 200f), true);
						for (int num10 = 0; num10 < Globals.badgeNames.Count; num10++)
						{
							if (string.IsNullOrEmpty(Globals.badgeSearch) || Globals.badgeNames[num10].ToLower().Contains(Globals.badgeSearch.ToLower()))
							{
								ACHIEVEMENTTYPE type = Globals.badges[num10];
								bool flag7 = Utilities.IsBadgeUnlocked(type);
								ImGui.PushStyleColor((ImGuiCol)0, flag7 ? new Vector4(0.45f, 0.75f, 0.4f, 1f) : new Vector4(0.75f, 0.75f, 0.75f, 1f));
								if (ImGui.Button("Unlock##" + Globals.badgeNames[num10]))
								{
									Utilities.UnlockBadge(type);
								}
								ImGui.SameLine();
								ImGui.Text((flag7 ? "OWNED" : "LOCKED") + "  " + Globals.badgeNames[num10]);
								ImGui.PopStyleColor();
							}
						}
						ImGui.EndChild();
						ImGui.Dummy(new Vector2(4f, 4f));
						if (ImGui.Button("Unlock All Badges"))
						{
							Utilities.UnlockAllBadges();
						}
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						ImGui.Text("Ascent Level");
						ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 20f);
						int ascentLevel = Globals.ascentLevel;
						if (ImGui.SliderInt("##ascent_level", ref ascentLevel, 1, 8, "Ascent Level: %d"))
						{
							Globals.ascentLevel = ascentLevel;
						}
						ImGui.Dummy(new Vector2(4f, 2f));
						if (ImGui.Button("Grant Ascent Level"))
						{
							Utilities.GrantAscentLevel(Globals.ascentLevel);
						}
						ImGui.SameLine();
						DrawToolTip("Grants the selected ascent milestone badge for your current run.");
					}
					ImGui.Unindent();
					ImGui.EndChild();
					ImGui.Unindent();
					ImGui.EndChild();
				}
				else if (selectedTab == 8)
				{
					if (Globals.allPlayers.Count == 0)
					{
						Utilities.RefreshPlayerList();
					}
					if (Globals.hostStatusNames.Count == 0)
					{
						Utilities.RefreshHostStatuses();
					}
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					ImGui.TextWrapped("These actions only work when YOU are the session host (master client). They use server-gated RPCs.");
					ImGui.Spacing();
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					if (ImGui.BeginCombo("Host Target", (Globals.selectedPlayer >= 0 && Globals.selectedPlayer < Globals.playerNames.Count) ? Globals.playerNames[Globals.selectedPlayer] : "None"))
					{
						for (int num11 = 0; num11 < Globals.playerNames.Count; num11++)
						{
							bool flag8 = Globals.selectedPlayer == num11;
							if (ImGui.Selectable(Globals.playerNames[num11], flag8))
							{
								Globals.selectedPlayer = num11;
							}
						}
						ImGui.EndCombo();
					}
					ImGui.Dummy(new Vector2(4f, 4f));
					if (ImGui.Button("Kick Selected Player"))
					{
						Utilities.HostKickSelected();
					}
					DrawToolTip("Kicks the selected player from the session (host only).");
					ImGui.Separator();
					ImGui.Text("Give Status (Host)");
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					if (ImGui.BeginCombo("Status Type", (Globals.selectedHostStatusIndex >= 0 && Globals.selectedHostStatusIndex < Globals.hostStatusNames.Count) ? Globals.hostStatusNames[Globals.selectedHostStatusIndex] : "None"))
					{
						for (int num12 = 0; num12 < Globals.hostStatusNames.Count; num12++)
						{
							bool flag9 = Globals.selectedHostStatusIndex == num12;
							if (ImGui.Selectable(Globals.hostStatusNames[num12], flag9))
							{
								Globals.selectedHostStatusIndex = num12;
							}
						}
						ImGui.EndCombo();
					}
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					float hostStatusAmount = Globals.hostStatusAmount;
					if (ImGui.InputFloat("##host_status_amount", ref hostStatusAmount, 1f, 5f, "%.1f"))
					{
						Globals.hostStatusAmount = hostStatusAmount;
					}
					ImGui.SameLine();
					DrawToolTip("Amount of the status to add to the target.");
					if (ImGui.Button("Give Status To Selected"))
					{
						Utilities.HostGiveStatusToSelected((STATUSTYPE)Globals.hostStatusTypes[Globals.selectedHostStatusIndex], Globals.hostStatusAmount);
					}
					ImGui.Separator();
					ImGui.Text("Remove Slot (Host)");
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					int hostRemoveSlot = Globals.hostRemoveSlot;
					if (ImGui.SliderInt("##host_remove_slot", ref hostRemoveSlot, 0, 8, "Slot: %d"))
					{
						Globals.hostRemoveSlot = hostRemoveSlot;
					}
					if (ImGui.Button("Remove Item From Slot"))
					{
						Utilities.HostRemoveSlotSelected(Globals.hostRemoveSlot);
					}
					DrawToolTip("Removes the item in the chosen slot from the selected player's inventory (host only).");
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					int selectedSpawnItem = Globals.selectedSpawnItem;
					if (ImGui.BeginCombo("Item to Place", (selectedSpawnItem >= 0 && selectedSpawnItem < Globals.itemNames.Count) ? Globals.itemNames[selectedSpawnItem] : "None"))
					{
						for (int num13 = 0; num13 < Globals.itemNames.Count; num13++)
						{
							bool flag10 = selectedSpawnItem == num13;
							if (ImGui.Selectable(Globals.itemNames[num13], flag10))
							{
								Globals.selectedSpawnItem = num13;
							}
						}
						ImGui.EndCombo();
					}
					if (ImGui.Button("Fill Slot With Item (Host)"))
					{
						Utilities.HostFillSelectedSlot(Globals.hostRemoveSlot, Globals.selectedSpawnItem);
					}
					DrawToolTip("Places the chosen item into the selected slot of the selected player's inventory (host only).");
					ImGui.Separator();
					ImGui.Text("Character Actions (Host)");
					if (ImGui.Button("Pass Out Selected"))
					{
						Utilities.HostPassOutSelected();
					}
					DrawToolTip("Causes the selected player to pass out (host only).");
					if (ImGui.Button("Zombify Selected"))
					{
						Utilities.HostZombifySelected();
					}
					DrawToolTip("Turns the selected player into a zombie (host only).");
					ImGui.Separator();
					ImGui.Text("Backpack (Host)");
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					int inventorySlot = 0;
					ImGui.SliderInt("##host_inv_slot", ref inventorySlot, 0, 7, "Inventory Slot: %d");
					ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - 4f);
					int backpackSlot = 0;
					ImGui.SliderInt("##host_backpack_slot", ref backpackSlot, 0, 15, "Backpack Pocket: %d");
					if (ImGui.Button("Move Slot To Backpack (Host)"))
					{
						Utilities.HostAddToBackpackSelected(inventorySlot, backpackSlot);
					}
					DrawToolTip("Moves the item in the chosen inventory slot to the selected player's backpack (host only).");
				}
				else if (selectedTab == 9)
				{
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					if (ImGui.CollapsingHeader("Player Profile", (ImGuiTreeNodeFlags)32))
					{
						ImGui.TextWrapped("Save or load all of your PLAYER tab options (self mods, statuses, fly/speed/jump settings). These options only affect YOUR character.");
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.PushStyleColor((ImGuiCol)21, new Vector4(0.2f, 0.45f, 0.25f, 1f));
						if (ImGui.Button("Save Current Player Profile"))
						{
							Utilities.SavePlayerProfile();
						}
						ImGui.PopStyleColor();
						DrawToolTip("Writes all PLAYER tab options to a profile file on disk.");
						if (ImGui.Button("Load Saved Player Profile"))
						{
							Utilities.LoadPlayerProfile();
						}
						DrawToolTip("Restores all PLAYER tab options from the saved profile and applies them.");
						ImGui.Dummy(new Vector2(4f, 4f));
						ImGui.Separator();
						ImGui.TextWrapped("The profile is saved to: BepInEx/config/PeakModPlayerProfile.json\nOnly PLAYER tab options are stored - inventory, spawn, host and stage settings are not part of a profile.");
					}
					ImGui.Unindent();
				}
				else if (selectedTab == 10)
				{
					ImGui.Indent(4f);
					ImGui.Dummy(new Vector2(4f, 2f));
					ImGui.Text("PeakMod V0.4.0 by TheLocalAdmin");
					ImGui.Separator();
					ImGui.Text("Version: 0.4.0");
					ImGui.Text("Author: TheLocalAdmin");
					ImGui.Spacing();
					ImGui.TextWrapped("A feature-rich quality-of-life and utility mod for PEAK v2.4.a: player enhancements, inventory tools, stage teleportation, badge unlocking, world manipulation, player effects, and lobby control in a clean dark ImGui interface.");
					ImGui.Spacing();
					ImGui.Text("Key Features:");
					ImGui.BulletText("Infinite stamina and affliction immunity");
					ImGui.BulletText("Adjustable movement: speed, jump, and climb mods");
					ImGui.BulletText("Real-time inventory editing and recharge");
					ImGui.BulletText("Teleport to any mountain stage (Beach to Peak)");
					ImGui.BulletText("Unlock all badges and grant ascent levels");
					ImGui.BulletText("Player-to-player warp, revive, and kill tools");
					ImGui.BulletText("Teleport players to custom coordinates (Lobby tab)");
					ImGui.BulletText("Spawn any item into any player's hand (works as non-host)");
					ImGui.BulletText("Host tab: kick, status-giving, slot editing, pass-out, zombify, backpack control");
					ImGui.BulletText("Coordinate overlay showing all players and luggage positions");
					ImGui.BulletText("Badge management: unlock all badges and ascent levels");
					ImGui.BulletText("Luggage ESP with configurable glowing boxes");
					ImGui.BulletText("Custom keybinds for fly mode and coordinate overlay");
					ImGui.BulletText("Save/load player profiles with all settings");
					ImGui.BulletText("Stylized dark UI with tabbed interface");
					ImGui.Spacing();
					ImGui.Text("Special Thanks:");
					ImGui.BulletText("Penswer for insight, and guidance");
					ImGui.BulletText("BepInEx team for the modding framework");
					ImGui.BulletText("DearImGuiInjection for seamless UI integration");
					ImGui.BulletText("HarmonyX for runtime patching support");
					ImGui.Spacing();
					ImGui.Separator();
					ImGui.TextWrapped("This mod is provided as-is for educational and personal use. Not affiliated with or endorsed by the developers of PEAK. Use responsibly.");
					ImGui.Unindent();
				}
				ImGui.EndChild();
			}
			ImGui.End();
		}
		catch (Exception ex)
		{
			ConfigManager.Logger.LogError((object)("[UI ERROR] Exception in MyUI: " + ex));
		}
	}
}
public static class Utilities
{
	private static ManualLogSource LoggerInternal;

	public static bool hasInitializedLuggageList = false;

	private static float _lastLuggageRefreshTime = -999f;

	private static string profilePath = Path.Combine(Paths.ConfigPath, "PeakModPlayerProfile.json");

	public static ManualLogSource Logger
	{
		get
		{
			if (LoggerInternal == null && ConfigManager.Logger != null)
			{
				LoggerInternal = ConfigManager.Logger;
			}
			return LoggerInternal;
		}
		set
		{
			LoggerInternal = value;
		}
	}

	public static void GetPlayer()
	{
		if ((Object)(object)Globals.playerObj == (Object)null)
		{
			Globals.playerObj = Player.localPlayer;
		}
	}

	public static void UpdateItems()
	{
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			try
			{
				Globals.items.Clear();
				Globals.itemNames.Clear();
				Globals.itemPrefabNames.Clear();
				for (int i = 0; i < 3; i++)
				{
					Globals.selectedItems[i] = -1;
				}
				ItemDatabase instance = SingletonAsset<ItemDatabase>.Instance;
				if ((Object)(object)instance != (Object)null && ((DatabaseAsset<ItemDatabase, Item>)(object)instance).Objects != null && ((DatabaseAsset<ItemDatabase, Item>)(object)instance).Objects.Count > 0)
				{
					foreach (Item @object in ((DatabaseAsset<ItemDatabase, Item>)(object)instance).Objects)
					{
						if (!((Object)(object)@object == (Object)null) && !string.IsNullOrEmpty(@object.GetName()))
						{
							Globals.items.Add(@object);
							Globals.itemNames.Add(@object.GetName());
							Globals.itemPrefabNames.Add(((Object)(object)((Component)@object).gameObject != (Object)null) ? ((Object)((Component)@object).gameObject).name : @object.GetName());
						}
					}
				}
				else
				{
					Object[] array = Resources.FindObjectsOfTypeAll(typeof(Item));
					foreach (Object obj in array)
					{
						Item val = (Item)(object)((obj is Item) ? obj : null);
						if ((Object)(object)val != (Object)null && !string.IsNullOrEmpty(val.GetName()))
						{
							Globals.items.Add(val);
							Globals.itemNames.Add(val.GetName());
							Globals.itemPrefabNames.Add(((Object)(object)((Component)val).gameObject != (Object)null) ? ((Object)((Component)val).gameObject).name : val.GetName());
						}
					}
				}
				List<(string, int)> list = new List<(string, int)>();
				for (int k = 0; k < Globals.itemNames.Count; k++)
				{
					list.Add((Globals.itemNames[k], k));
				}
				list.Sort(((string name, int idx) a, (string name, int idx) b) => string.Compare(a.name, b.name, StringComparison.OrdinalIgnoreCase));
				List<Item> list2 = new List<Item>();
				List<string> list3 = new List<string>();
				List<string> list4 = new List<string>();
				foreach (var item in list)
				{
					list2.Add(Globals.items[item.Item2]);
					list3.Add(item.Item1);
					list4.Add(Globals.itemPrefabNames[item.Item2]);
				}
				Globals.items = list2;
				Globals.itemNames = list3;
				Globals.itemPrefabNames = list4;
				Logger.LogInfo((object)$"[PeakMod] Item list loaded: {Globals.itemNames.Count} items (via ItemDatabase).");
			}
			catch (Exception ex)
			{
				ConfigManager.Logger.LogError((object)("[PeakMod] UpdateItems failed: " + ex));
			}
		});
	}

	public static void AssignInventoryItem(int slot, int itemIndex)
	{
		GetPlayer();
		if ((Object)(object)Globals.playerObj == (Object)null)
		{
			Logger.LogError((object)"[PeakMod] Player is null during inventory operation");
		}
		else
		{
			if (!((Object)(object)Globals.playerObj != (Object)null) || Globals.playerObj.itemSlots == null || Globals.playerObj.itemSlots.Length <= slot || itemIndex < 0 || itemIndex >= Globals.items.Count)
			{
				return;
			}
			int capturedItemIndex = itemIndex;
			int capturedSlot = slot;
			UnityMainThreadDispatcher.Enqueue((Action)delegate
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Expected O, but got Unknown
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				ItemSlot val = Globals.playerObj.itemSlots[capturedSlot];
				Item val2 = Globals.items[capturedItemIndex];
				if (val != null && !((Object)(object)val2 == (Object)null))
				{
					val.SetItem(val2, new ItemInstanceData(Guid.NewGuid()));
					ItemInstanceDataHandler.AddInstanceData(val.data);
					byte[] array = IBinarySerializable.ToManagedArray<InventorySyncData>(new InventorySyncData(Globals.playerObj.itemSlots, Globals.playerObj.backpackSlot, Globals.playerObj.tempFullSlot));
					((MonoBehaviourPun)Globals.playerObj).photonView.RPC("SyncInventoryRPC", (RpcTarget)1, new object[2] { array, true });
				}
			});
			Logger.LogInfo((object)$"[PeakMod] Assigned {Globals.itemNames[itemIndex]} to slot {slot}");
		}
	}

	public static void RechargeInventorySlot(int slot, float rechargeValue)
	{
		GetPlayer();
		if ((Object)(object)Globals.playerObj == (Object)null)
		{
			Logger.LogError((object)"[PeakMod] Player is null during inventory operation");
		}
		else
		{
			if (!((Object)(object)Globals.playerObj != (Object)null) || Globals.playerObj.itemSlots == null || Globals.playerObj.itemSlots.Length <= slot)
			{
				return;
			}
			int capturedSlot = slot;
			float capturedValue = rechargeValue;
			UnityMainThreadDispatcher.Enqueue((Action)delegate
			{
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Invalid comparison between Unknown and I4
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Invalid comparison between Unknown and I4
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Invalid comparison between Unknown and I4
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dd: Invalid comparison between Unknown and I4
				ItemSlot val = Globals.playerObj.itemSlots[capturedSlot];
				if (((val == null) ? null : val.data?.data) != null)
				{
					foreach (KeyValuePair<DataEntryKey, DataEntryValue> datum in val.data.data)
					{
						if ((int)datum.Key == 12)
						{
							DataEntryValue value = datum.Value;
							IntItemData val2 = (IntItemData)(object)((value is IntItemData) ? value : null);
							if (val2 != null)
							{
								val2.Value = (int)capturedValue;
							}
						}
						else if ((int)datum.Key == 10)
						{
							DataEntryValue value2 = datum.Value;
							FloatItemData val3 = (FloatItemData)(object)((value2 is FloatItemData) ? value2 : null);
							if (val3 != null)
							{
								val3.Value = capturedValue;
							}
						}
						else if ((int)datum.Key == 11)
						{
							DataEntryValue value3 = datum.Value;
							FloatItemData val4 = (FloatItemData)(object)((value3 is FloatItemData) ? value3 : null);
							if (val4 != null)
							{
								val4.Value = capturedValue;
							}
						}
						else if ((int)datum.Key == 2)
						{
							DataEntryValue value4 = datum.Value;
							OptionableIntItemData val5 = (OptionableIntItemData)(object)((value4 is OptionableIntItemData) ? value4 : null);
							if (val5 != null)
							{
								val5.Value = (int)capturedValue;
							}
						}
					}
				}
			});
			Logger.LogInfo((object)$"[PeakMod] Recharged slot {slot} to {rechargeValue}");
		}
	}

	public static void RefreshPlayerList()
	{
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			try
			{
				Globals.allPlayers.Clear();
				Globals.playerNames.Clear();
				Globals.selectedPlayer = -1;
				foreach (Character allCharacter in Character.AllCharacters)
				{
					Globals.allPlayers.Add(allCharacter);
					Globals.playerNames.Add(allCharacter.characterName);
				}
				Logger.LogInfo((object)$"[PeakMod] Found {Globals.allPlayers.Count} players.");
			}
			catch (Exception ex)
			{
				ConfigManager.Logger.LogError((object)ex);
			}
		});
	}

	public static void ReviveAllPlayers()
	{
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			foreach (Character allCharacter in Character.AllCharacters)
			{
				Vector3 safeRevivePosition = GetSafeRevivePosition(allCharacter);
				((MonoBehaviourPun)allCharacter).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[3] { safeRevivePosition, true, -1 });
			}
			Logger.LogInfo((object)"[PeakMod] Revive All triggered.");
		});
	}

	public static void KillAllPlayers()
	{
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			foreach (Character allCharacter in Character.AllCharacters)
			{
				if (!Globals.excludeSelfFromAllActions || !allCharacter.IsLocal)
				{
					((MonoBehaviourPun)allCharacter).photonView.RPC("RPCA_Die", (RpcTarget)0, new object[0]);
				}
			}
			Logger.LogInfo((object)$"[PeakMod] Kill All triggered. ExcludeSelf: {Globals.excludeSelfFromAllActions}");
		});
	}

	public static void WarpAllPlayersToMe()
	{
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Character.localCharacter.Head + new Vector3(0f, 4f, 0f);
			foreach (Character allCharacter in Character.AllCharacters)
			{
				((MonoBehaviourPun)allCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, true });
			}
			Logger.LogInfo((object)"[PeakMod] Warp All To Me triggered.");
		});
	}

	public static void ReviveSelectedPlayer()
	{
		if (Globals.selectedPlayer < 0 || Globals.selectedPlayer >= Globals.allPlayers.Count)
		{
			return;
		}
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Character obj = Globals.allPlayers[Globals.selectedPlayer];
				Vector3 safeRevivePosition = GetSafeRevivePosition(obj);
				((MonoBehaviourPun)obj).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[3] { safeRevivePosition, true, -1 });
				Logger.LogInfo((object)$"[PeakMod] Revive requested for player index {Globals.selectedPlayer}");
			}
			catch (Exception ex)
			{
				ConfigManager.Logger.LogError((object)ex);
			}
		});
	}

	public static void KillSelectedPlayer()
	{
		if (Globals.selectedPlayer < 0 || Globals.selectedPlayer >= Globals.allPlayers.Count)
		{
			return;
		}
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			try
			{
				((MonoBehaviourPun)Globals.allPlayers[Globals.selectedPlayer]).photonView.RPC("RPCA_Die", (RpcTarget)0, new object[0]);
				Logger.LogInfo((object)$"[PeakMod] Kill requested for player index {Globals.selectedPlayer}");
			}
			catch (Exception ex)
			{
				ConfigManager.Logger.LogError((object)ex);
			}
		});
	}

	public static void WarpToSelectedPlayer()
	{
		if (Globals.selectedPlayer < 0 || Globals.selectedPlayer >= Globals.allPlayers.Count)
		{
			return;
		}
		UnityMainThreadDispatcher.Enqueue((Action)delegate
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Vector3 val = Globals.allPlayers[Globals.selectedPlayer].Head + new Vector3(0f, 4f, 0f);
				((MonoBehaviourPun)Character.localCharacter).photonView.RPC("WarpPlayerRPC", (Rpc