Decompiled source of StatsOverlay v0.1.1

BepInEx/plugins/StatsOverlay/StatsOverlay.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HG;
using HarmonyLib;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using On.RoR2;
using RoR2;
using RoR2.Stats;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("StatsOverlay")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StatsOverlay")]
[assembly: AssemblyTitle("StatsOverlay")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace StatsOverlay
{
	public static class AdminActions
	{
		private static readonly Dictionary<CharacterMaster, (int collidableMask, CharacterMotor motor)> NoClipLayerBackup = new Dictionary<CharacterMaster, (int, CharacterMotor)>();

		public static readonly HashSet<CharacterMaster> InvisibleMasters = new HashSet<CharacterMaster>();

		public static readonly HashSet<CharacterMaster> NoGravityMasters = new HashSet<CharacterMaster>();

		public static readonly HashSet<CharacterMaster> NoClipMasters = new HashSet<CharacterMaster>();

		public static readonly HashSet<CharacterMaster> InstantSkillsMasters = new HashSet<CharacterMaster>();

		public static readonly Dictionary<CharacterMaster, float> DamageMultMasters = new Dictionary<CharacterMaster, float>();

		public static readonly Dictionary<CharacterMaster, float> AttackSpeedMultMasters = new Dictionary<CharacterMaster, float>();

		private static readonly Dictionary<int, Renderer[]> InvisibleRendererCache = new Dictionary<int, Renderer[]>();

		public static CharacterMaster GetLocalMaster()
		{
			LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
			if (firstLocalUser == null)
			{
				return null;
			}
			return firstLocalUser.cachedMaster;
		}

		public static CharacterMaster GetOtherPlayerMaster()
		{
			CharacterMaster localMaster = GetLocalMaster();
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if ((Object)(object)instance != (Object)null && (Object)(object)instance.master != (Object)null && (Object)(object)instance.master != (Object)(object)localMaster)
				{
					return instance.master;
				}
			}
			return null;
		}

		public static void GiveMoney(CharacterMaster target, uint amount)
		{
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				target.GiveMoney(amount);
			}
		}

		public static void TakeMoney(CharacterMaster target, uint amount)
		{
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				target.money = ((target.money > amount) ? (target.money - amount) : 0u);
			}
		}

		public static void SetMoney(CharacterMaster target, uint amount)
		{
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				target.money = amount;
			}
		}

		public static void SetGodMode(CharacterMaster target, bool value)
		{
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				CharacterBody body = target.GetBody();
				if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null))
				{
					body.healthComponent.godMode = value;
				}
			}
		}

		public static void HealFull(CharacterMaster target)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				CharacterBody body = target.GetBody();
				if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null))
				{
					body.healthComponent.HealFraction(1f, default(ProcChainMask));
				}
			}
		}

		public static void Kill(CharacterMaster target)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				CharacterBody body = target.GetBody();
				if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null))
				{
					body.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
				}
			}
		}

		public static void SetHealthToOne(CharacterMaster target)
		{
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				CharacterBody body = target.GetBody();
				if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null))
				{
					body.healthComponent.health = 1f;
				}
			}
		}

		public static void SetHealthFraction(CharacterMaster target, float fraction)
		{
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				CharacterBody body = target.GetBody();
				if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null))
				{
					body.healthComponent.health = Mathf.Max(1f, body.healthComponent.fullHealth * fraction);
				}
			}
		}

		public static void AdvanceToNextStage()
		{
			if (!NetworkServer.active)
			{
				return;
			}
			Run instance = Run.instance;
			if (!((Object)(object)instance == (Object)null))
			{
				if ((Object)(object)instance.nextStageScene == (Object)null)
				{
					instance.PickNextStageSceneFromCurrentSceneDestinations();
				}
				if ((Object)(object)instance.nextStageScene != (Object)null)
				{
					instance.AdvanceStage(instance.nextStageScene);
				}
			}
		}

		public static void SetInvisible(CharacterMaster target, bool value)
		{
			if ((Object)(object)target == (Object)null)
			{
				return;
			}
			if (value)
			{
				InvisibleMasters.Add(target);
				if (NetworkServer.active)
				{
					CharacterBody body = target.GetBody();
					if ((Object)(object)body != (Object)null && !body.HasBuff(Buffs.Intangible))
					{
						body.AddBuff(Buffs.Intangible);
					}
				}
			}
			else
			{
				InvisibleMasters.Remove(target);
				CharacterBody body2 = target.GetBody();
				if ((Object)(object)body2 != (Object)null && NetworkServer.active)
				{
					body2.RemoveBuff(Buffs.Intangible);
					RestoreInvisibleVisualLocal(body2);
				}
			}
		}

		public static void SetNoGravity(CharacterMaster target, bool value)
		{
			if ((Object)(object)target == (Object)null)
			{
				return;
			}
			if (value)
			{
				NoGravityMasters.Add(target);
				return;
			}
			NoGravityMasters.Remove(target);
			CharacterBody body = target.GetBody();
			if ((Object)(object)body != (Object)null && (Object)(object)body.characterMotor != (Object)null)
			{
				body.characterMotor.gravityScale = 1f;
			}
		}

		public static void SetNoClip(CharacterMaster target, bool value)
		{
			if (!((Object)(object)target == (Object)null))
			{
				if (value)
				{
					NoClipMasters.Add(target);
					return;
				}
				NoClipMasters.Remove(target);
				RestoreNoClipPhysics(target);
			}
		}

		private static void RestoreNoClipPhysics(CharacterMaster master)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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)
			CharacterBody body = master.GetBody();
			CharacterMotor val = ((body != null) ? body.characterMotor : null);
			if ((Object)(object)((val != null) ? ((BaseCharacterController)val).Motor : null) != (Object)null && NoClipLayerBackup.TryGetValue(master, out (int, CharacterMotor) value))
			{
				KinematicCharacterMotor motor = ((BaseCharacterController)val).Motor;
				LayerMask collidableLayers = default(LayerMask);
				((LayerMask)(ref collidableLayers)).value = value.Item1;
				motor.CollidableLayers = collidableLayers;
			}
			NoClipLayerBackup.Remove(master);
			if (!NoGravityMasters.Contains(master) && (Object)(object)val != (Object)null)
			{
				val.gravityScale = 1f;
			}
		}

		private static void EnsureNoClipLayerBackup(CharacterMaster master, CharacterMotor motor)
		{
			if (!NoClipLayerBackup.TryGetValue(master, out (int, CharacterMotor) value) || (Object)(object)value.Item2 != (Object)(object)motor)
			{
				NoClipLayerBackup[master] = (((LayerMask)(ref ((BaseCharacterController)motor).Motor.CollidableLayers)).value, motor);
			}
		}

		private static void ApplyNoClipFlight(CharacterBody body, float dt)
		{
			//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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			CharacterMotor characterMotor = body.characterMotor;
			CharacterMaster master = body.master;
			InputBankTest inputBank = body.inputBank;
			if (!((Object)(object)((characterMotor != null) ? ((BaseCharacterController)characterMotor).Motor : null) == (Object)null) && !((Object)(object)master == (Object)null) && !((Object)(object)inputBank == (Object)null))
			{
				EnsureNoClipLayerBackup(master, characterMotor);
				characterMotor.gravityScale = 0f;
				characterMotor.velocity = Vector3.zero;
				((BaseCharacterController)characterMotor).Motor.CollidableLayers = default(LayerMask);
				Vector3 moveVector = inputBank.moveVector;
				float num = 0f;
				if (inputBank.jump.down)
				{
					num += 1f;
				}
				if (IsNoClipDescendPressed(master))
				{
					num -= 1f;
				}
				moveVector.y = num;
				float num2 = (inputBank.sprint.down ? 42f : 22f);
				if (((Vector3)(ref moveVector)).sqrMagnitude > 1f)
				{
					((Vector3)(ref moveVector)).Normalize();
				}
				characterMotor.AddDisplacement(moveVector * num2 * dt);
			}
		}

		public static void SetInstantSkills(CharacterMaster target, bool value)
		{
			if (!((Object)(object)target == (Object)null))
			{
				if (value)
				{
					InstantSkillsMasters.Add(target);
				}
				else
				{
					InstantSkillsMasters.Remove(target);
				}
			}
		}

		public static void SetDamageMultiplier(CharacterMaster target, float multiplier)
		{
			if (!((Object)(object)target == (Object)null))
			{
				if (multiplier <= 1f)
				{
					DamageMultMasters.Remove(target);
				}
				else
				{
					DamageMultMasters[target] = multiplier;
				}
			}
		}

		public static void SetAttackSpeedMultiplier(CharacterMaster target, float multiplier)
		{
			if (!((Object)(object)target == (Object)null))
			{
				if (multiplier <= 1f)
				{
					AttackSpeedMultMasters.Remove(target);
				}
				else
				{
					AttackSpeedMultMasters[target] = multiplier;
				}
				CharacterBody body = target.GetBody();
				if ((Object)(object)body != (Object)null && NetworkServer.active)
				{
					body.RecalculateStats();
				}
			}
		}

		public static void GiveItem(CharacterMaster target, ItemIndex itemIndex, int count)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !((Object)(object)((target != null) ? target.inventory : null) == (Object)null) && count > 0)
			{
				target.inventory.GiveItemPermanent(itemIndex, count);
			}
		}

		public static void RemoveItem(CharacterMaster target, ItemIndex itemIndex, int count)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !((Object)(object)((target != null) ? target.inventory : null) == (Object)null) && count > 0)
			{
				target.inventory.RemoveItemPermanent(itemIndex, count);
			}
		}

		public static void ClearAllPermanentItems(CharacterMaster target)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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)
			//IL_0048: Invalid comparison between Unknown and I4
			//IL_004a: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || (Object)(object)((target != null) ? target.inventory : null) == (Object)null)
			{
				return;
			}
			Inventory inventory = target.inventory;
			foreach (ItemIndex value in Enum.GetValues(typeof(ItemIndex)))
			{
				if ((int)value == -1)
				{
					continue;
				}
				ItemDef itemDef = ItemCatalog.GetItemDef(value);
				if (!((Object)(object)itemDef == (Object)null) && !itemDef.hidden)
				{
					int itemCountPermanent = inventory.GetItemCountPermanent(value);
					if (itemCountPermanent > 0)
					{
						inventory.RemoveItemPermanent(value, itemCountPermanent);
					}
				}
			}
		}

		public static void GiveEquipment(CharacterMaster target, EquipmentIndex equipmentIndex)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !((Object)(object)((target != null) ? target.inventory : null) == (Object)null) && (int)equipmentIndex != -1)
			{
				target.inventory.SetEquipmentIndex(equipmentIndex, false);
			}
		}

		public static void ClearAllEquipment(CharacterMaster target)
		{
			if (NetworkServer.active && !((Object)(object)((target != null) ? target.inventory : null) == (Object)null))
			{
				target.inventory.SetEquipmentIndex((EquipmentIndex)(-1), true);
			}
		}

		public static void TeleportBodyToFootPosition(CharacterMaster target, Vector3 targetFootPosition)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !((Object)(object)target == (Object)null))
			{
				CharacterBody body = target.GetBody();
				if (!((Object)(object)body == (Object)null))
				{
					TeleportHelper.TeleportBody(body, targetFootPosition, true);
				}
			}
		}

		public static bool TryGetTeleporterFootPosition(out Vector3 footPosition)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			footPosition = default(Vector3);
			TeleporterInteraction instance = TeleporterInteraction.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return false;
			}
			footPosition = ((Component)instance).transform.position;
			return true;
		}

		public static bool TryGetStageEntrySpawnFootPosition(out Vector3 footPosition)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			footPosition = default(Vector3);
			Stage instance = Stage.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return false;
			}
			Transform playerSpawnTransform = instance.GetPlayerSpawnTransform();
			if ((Object)(object)playerSpawnTransform == (Object)null)
			{
				return false;
			}
			footPosition = playerSpawnTransform.position;
			return true;
		}

		public static void Tick()
		{
			if (!NetworkServer.active)
			{
				return;
			}
			InvisibleMasters.RemoveWhere((CharacterMaster m) => (Object)(object)m == (Object)null);
			NoGravityMasters.RemoveWhere((CharacterMaster m) => (Object)(object)m == (Object)null);
			NoClipMasters.RemoveWhere((CharacterMaster m) => (Object)(object)m == (Object)null);
			InstantSkillsMasters.RemoveWhere((CharacterMaster m) => (Object)(object)m == (Object)null);
			foreach (CharacterMaster invisibleMaster in InvisibleMasters)
			{
				CharacterBody body = invisibleMaster.GetBody();
				if ((Object)(object)body != (Object)null && !body.HasBuff(Buffs.Intangible))
				{
					body.AddBuff(Buffs.Intangible);
				}
			}
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (!((Object)(object)((instance != null) ? instance.master : null) == (Object)null))
				{
					instance.master.hideAllyCard = InvisibleMasters.Contains(instance.master);
				}
			}
			foreach (CharacterMaster noGravityMaster in NoGravityMasters)
			{
				CharacterBody body2 = noGravityMaster.GetBody();
				if ((Object)(object)body2 != (Object)null && (Object)(object)body2.characterMotor != (Object)null)
				{
					body2.characterMotor.gravityScale = 0f;
				}
			}
			float fixedDeltaTime = Time.fixedDeltaTime;
			foreach (CharacterMaster noClipMaster in NoClipMasters)
			{
				CharacterBody body3 = noClipMaster.GetBody();
				if ((Object)(object)body3 != (Object)null)
				{
					ApplyNoClipFlight(body3, fixedDeltaTime);
				}
			}
			foreach (CharacterMaster instantSkillsMaster in InstantSkillsMasters)
			{
				CharacterBody body4 = instantSkillsMaster.GetBody();
				if (!((Object)(object)body4 == (Object)null) && !((Object)(object)body4.skillLocator == (Object)null))
				{
					ResetSkill(body4.skillLocator.primary);
					ResetSkill(body4.skillLocator.secondary);
					ResetSkill(body4.skillLocator.utility);
					ResetSkill(body4.skillLocator.special);
				}
			}
		}

		private static void ResetSkill(GenericSkill skill)
		{
			if (!((Object)(object)skill == (Object)null))
			{
				skill.stock = skill.maxStock;
				skill.rechargeStopwatch = 10000f;
			}
		}

		private static bool IsNoClipDescendPressed(CharacterMaster master)
		{
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				if (!((Object)(object)((readOnlyLocalUsers != null) ? readOnlyLocalUsers.cachedMaster : null) != (Object)(object)master))
				{
					return Input.GetKey((KeyCode)99);
				}
			}
			CharacterBody body = master.GetBody();
			InputBankTest val = ((body != null) ? body.inputBank : null);
			if ((Object)(object)val != (Object)null)
			{
				return val.rawMoveDown.down;
			}
			return false;
		}

		public static void SyncInvisibleVisuals()
		{
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				object obj;
				if (instance == null)
				{
					obj = null;
				}
				else
				{
					CharacterMaster master = instance.master;
					obj = ((master != null) ? master.GetBody() : null);
				}
				CharacterBody val = (CharacterBody)obj;
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				bool flag = val.HasBuff(Buffs.Intangible);
				val.CharacterIsVisible = !flag;
				Renderer[] cachedBodyRenderers = GetCachedBodyRenderers(val);
				foreach (Renderer val2 in cachedBodyRenderers)
				{
					if ((Object)(object)val2 != (Object)null)
					{
						val2.enabled = !flag;
					}
				}
				ModelLocator modelLocator = val.modelLocator;
				object obj2;
				if (modelLocator == null)
				{
					obj2 = null;
				}
				else
				{
					Transform modelTransform = modelLocator.modelTransform;
					obj2 = ((modelTransform != null) ? ((Component)modelTransform).GetComponent<CharacterModel>() : null);
				}
				CharacterModel val3 = (CharacterModel)obj2;
				if ((Object)(object)val3 != (Object)null)
				{
					val3.visibility = (VisibilityLevel)((!flag) ? 4 : 0);
					val3.SetVisible(!flag);
				}
			}
		}

		private static Renderer[] GetCachedBodyRenderers(CharacterBody body)
		{
			int instanceID = ((Object)((Component)body).gameObject).GetInstanceID();
			if (!InvisibleRendererCache.TryGetValue(instanceID, out var value) || value == null || value.Length == 0 || (Object)(object)value[0] == (Object)null)
			{
				ModelLocator modelLocator = body.modelLocator;
				Transform val = ((modelLocator != null) ? modelLocator.modelTransform : null);
				value = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponentsInChildren<Renderer>(true) : Array.Empty<Renderer>());
				InvisibleRendererCache[instanceID] = value;
			}
			return value;
		}

		private static void RestoreInvisibleVisualLocal(CharacterBody body)
		{
			body.CharacterIsVisible = true;
			Renderer[] cachedBodyRenderers = GetCachedBodyRenderers(body);
			foreach (Renderer val in cachedBodyRenderers)
			{
				if ((Object)(object)val != (Object)null)
				{
					val.enabled = true;
				}
			}
			ModelLocator modelLocator = body.modelLocator;
			object obj;
			if (modelLocator == null)
			{
				obj = null;
			}
			else
			{
				Transform modelTransform = modelLocator.modelTransform;
				obj = ((modelTransform != null) ? ((Component)modelTransform).GetComponent<CharacterModel>() : null);
			}
			CharacterModel val2 = (CharacterModel)obj;
			if ((Object)(object)val2 != (Object)null)
			{
				val2.visibility = (VisibilityLevel)4;
				val2.SetVisible(true);
			}
		}
	}
	public static class AdminPanel
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static WindowFunction <0>__DrawWindow;

			public static Action <1>__DrawMoneySection;

			public static Action <2>__DrawHealthSection;

			public static Action <3>__DrawMiscSection;

			public static Action <4>__DrawRunSection;

			public static Action <5>__DrawTeleportSection;

			public static Action <6>__DrawInventorySection;
		}

		[CompilerGenerated]
		private sealed class <OrderedInventoryTiers>d__47 : IEnumerable<ItemTier>, IEnumerable, IEnumerator<ItemTier>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private ItemTier <>2__current;

			private int <>l__initialThreadId;

			private HashSet<ItemTier> <seen>5__2;

			private ItemTier[] <>7__wrap2;

			private int <>7__wrap3;

			private IEnumerator <>7__wrap4;

			ItemTier IEnumerator<ItemTier>.Current
			{
				[DebuggerHidden]
				get
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <OrderedInventoryTiers>d__47(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 2)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<seen>5__2 = null;
				<>7__wrap2 = null;
				<>7__wrap4 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
					{
						<>1__state = -1;
						ItemTier[] array = new ItemTier[12];
						RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
						ItemTier[] array2 = (ItemTier[])(object)array;
						<seen>5__2 = new HashSet<ItemTier>();
						<>7__wrap2 = array2;
						<>7__wrap3 = 0;
						goto IL_009a;
					}
					case 1:
						<>1__state = -1;
						<>7__wrap3++;
						goto IL_009a;
					case 2:
						{
							<>1__state = -3;
							break;
						}
						IL_009a:
						if (<>7__wrap3 < <>7__wrap2.Length)
						{
							ItemTier item = <>7__wrap2[<>7__wrap3];
							<seen>5__2.Add(item);
							<>2__current = item;
							<>1__state = 1;
							return true;
						}
						<>7__wrap2 = null;
						<>7__wrap4 = Enum.GetValues(typeof(ItemTier)).GetEnumerator();
						<>1__state = -3;
						break;
					}
					while (<>7__wrap4.MoveNext())
					{
						ItemTier item2 = (ItemTier)<>7__wrap4.Current;
						if (!<seen>5__2.Contains(item2))
						{
							<>2__current = item2;
							<>1__state = 2;
							return true;
						}
					}
					<>m__Finally1();
					<>7__wrap4 = null;
					return false;
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<>7__wrap4 is IDisposable disposable)
				{
					disposable.Dispose();
				}
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}

			[DebuggerHidden]
			IEnumerator<ItemTier> IEnumerable<ItemTier>.GetEnumerator()
			{
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					return this;
				}
				return new <OrderedInventoryTiers>d__47(0);
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<ItemTier>)this).GetEnumerator();
			}
		}

		private const int WindowId = 11399181;

		private static bool _isOpen;

		private static Rect _windowRect = new Rect((float)(Screen.width - 520), 60f, 500f, 660f);

		private static readonly HashSet<CharacterMaster> _selectedMasters = new HashSet<CharacterMaster>();

		private static bool _initializedSelection;

		private static readonly Dictionary<string, bool> _sectionExpanded = new Dictionary<string, bool>
		{
			["money"] = true,
			["health"] = false,
			["misc"] = false,
			["run"] = false,
			["teleport"] = false,
			["inventory"] = false
		};

		private static Vector2 _scrollPos;

		private static string _invSearchQuery = "";

		private static readonly Dictionary<ItemTier, bool> _invTierOpen = new Dictionary<ItemTier, bool>();

		private static bool _invTierFoldoutsInitialized;

		private static bool _invEquipmentOpen = true;

		private static bool _invSubtractMode;

		private static bool _invSearchTyping;

		private static bool _invSearchFocusPending;

		private const string InvSearchControlName = "StatsOverlay_AdminInvSearch";

		private const float InvIconCellSize = 48f;

		private const int InvIconsPerRow = 8;

		private static GUIStyle _windowStyle;

		private static GUIStyle _buttonStyle;

		private static GUIStyle _sectionHeaderStyle;

		private static GUIStyle _sectionBoxStyle;

		private static GUIStyle _toggleStyle;

		private static GUIStyle _targetInfoStyle;

		private static GUIStyle _topHeaderStyle;

		private static GUIStyle _tinyBtnStyle;

		private static GUIStyle _searchFieldStyle;

		private static GUIStyle _invTierHeaderStyle;

		private static GUIStyle _invIconSlotStyle;

		private static Texture2D _sectionBg;

		public static void Toggle()
		{
			_isOpen = !_isOpen;
			if (!_isOpen)
			{
				_invSearchTyping = false;
				_invSearchFocusPending = false;
				GUI.FocusControl("");
			}
		}

		private static void EnsureStyles()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: 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)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_008c: 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_009b: Expected O, but got Unknown
			//IL_00a0: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_00c5: 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)
			//IL_00d6: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_0119: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			//IL_016a: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Expected O, but got Unknown
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01bb: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Expected O, but got Unknown
			//IL_0254: Expected O, but got Unknown
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Expected O, but got Unknown
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Expected O, but got Unknown
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Expected O, but got Unknown
			//IL_02e1: Expected O, but got Unknown
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Expected O, but got Unknown
			//IL_030c: Expected O, but got Unknown
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Expected O, but got Unknown
			if (_windowStyle == null)
			{
				_sectionBg = new Texture2D(1, 1);
				_sectionBg.SetPixel(0, 0, new Color(1f, 1f, 1f, 0.04f));
				_sectionBg.Apply();
				_windowStyle = new GUIStyle(GUI.skin.window)
				{
					fontSize = 14,
					fontStyle = (FontStyle)1
				};
				_buttonStyle = new GUIStyle(GUI.skin.button)
				{
					fontSize = 12,
					padding = new RectOffset(8, 8, 6, 6),
					margin = new RectOffset(2, 2, 2, 2)
				};
				GUIStyle val = new GUIStyle(GUI.skin.button)
				{
					fontSize = 13,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)3,
					padding = new RectOffset(10, 10, 6, 6),
					margin = new RectOffset(0, 0, 4, 2)
				};
				val.normal.textColor = new Color(1f, 0.78f, 0.2f);
				val.hover.textColor = Color.white;
				_sectionHeaderStyle = val;
				GUIStyle val2 = new GUIStyle(GUI.skin.label)
				{
					fontSize = 13,
					fontStyle = (FontStyle)1
				};
				val2.normal.textColor = new Color(1f, 0.78f, 0.2f);
				val2.padding = new RectOffset(0, 0, 6, 4);
				_topHeaderStyle = val2;
				GUIStyle val3 = new GUIStyle(GUI.skin.box);
				val3.normal.background = _sectionBg;
				val3.border = new RectOffset(0, 0, 0, 0);
				val3.padding = new RectOffset(8, 8, 6, 8);
				val3.margin = new RectOffset(0, 0, 0, 4);
				_sectionBoxStyle = val3;
				GUIStyle val4 = new GUIStyle(GUI.skin.toggle)
				{
					fontSize = 12
				};
				val4.normal.textColor = Color.white;
				val4.onNormal.textColor = Color.white;
				val4.hover.textColor = new Color(1f, 0.95f, 0.7f);
				val4.onHover.textColor = new Color(1f, 0.95f, 0.7f);
				val4.padding = new RectOffset(20, 4, 2, 2);
				val4.margin = new RectOffset(2, 2, 2, 2);
				_toggleStyle = val4;
				GUIStyle val5 = new GUIStyle(GUI.skin.label)
				{
					fontSize = 11,
					fontStyle = (FontStyle)2
				};
				val5.normal.textColor = new Color(0.7f, 0.7f, 0.7f);
				_targetInfoStyle = val5;
				_tinyBtnStyle = new GUIStyle(_buttonStyle)
				{
					fontSize = 11,
					fixedHeight = 22f,
					fixedWidth = 44f,
					padding = new RectOffset(4, 4, 3, 3),
					margin = new RectOffset(2, 2, 2, 2)
				};
				_searchFieldStyle = new GUIStyle(GUI.skin.textField)
				{
					fontSize = 12,
					margin = new RectOffset(2, 2, 4, 4)
				};
				GUIStyle val6 = new GUIStyle(_targetInfoStyle)
				{
					fontStyle = (FontStyle)1
				};
				val6.normal.textColor = new Color(1f, 0.82f, 0.38f);
				_invTierHeaderStyle = val6;
				GUIStyle val7 = new GUIStyle(GUI.skin.box)
				{
					alignment = (TextAnchor)4,
					fontSize = 18,
					fontStyle = (FontStyle)1
				};
				val7.normal.textColor = new Color(0.85f, 0.85f, 0.85f, 1f);
				_invIconSlotStyle = val7;
			}
		}

		public static void Draw()
		{
			//IL_0028: 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)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			if (_isOpen && NetworkServer.active && !((Object)(object)Run.instance == (Object)null))
			{
				EnsureStyles();
				Rect windowRect = _windowRect;
				object obj = <>O.<0>__DrawWindow;
				if (obj == null)
				{
					WindowFunction val = DrawWindow;
					<>O.<0>__DrawWindow = val;
					obj = (object)val;
				}
				_windowRect = GUI.Window(11399181, windowRect, (WindowFunction)obj, ModsL10n.AdminWindowTitle, _windowStyle);
			}
		}

		private static void DrawWindow(int id)
		{
			//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_0124: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Space(4f);
			DrawTargetSection();
			_scrollPos = GUILayout.BeginScrollView(_scrollPos, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			DrawSection("money", DrawMoneySection);
			DrawSection("health", DrawHealthSection);
			DrawSection("misc", DrawMiscSection);
			DrawSection("run", DrawRunSection);
			DrawSection("teleport", DrawTeleportSection);
			DrawSection("inventory", DrawInventorySection);
			GUILayout.EndScrollView();
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 24f));
		}

		private static void DrawTargetSection()
		{
			GUILayout.Label(ModsL10n.TargetHeading, _topHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(_sectionBoxStyle, Array.Empty<GUILayoutOption>());
			if (!_initializedSelection)
			{
				CharacterMaster localMaster = AdminActions.GetLocalMaster();
				if ((Object)(object)localMaster != (Object)null)
				{
					_selectedMasters.Add(localMaster);
					_initializedSelection = true;
				}
			}
			CharacterMaster localMaster2 = AdminActions.GetLocalMaster();
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.master == (Object)null))
				{
					string text = (((Object)(object)instance.networkUser != (Object)null && !string.IsNullOrEmpty(instance.networkUser.userName)) ? instance.networkUser.userName : ModsL10n.PlayerFallback);
					string text2 = (((Object)(object)instance.master == (Object)(object)localMaster2) ? (text + ModsL10n.YouSuffix) : text);
					bool flag = _selectedMasters.Contains(instance.master);
					bool flag2 = GUILayout.Toggle(flag, " " + text2, _toggleStyle, Array.Empty<GUILayoutOption>());
					if (flag2 && !flag)
					{
						_selectedMasters.Add(instance.master);
					}
					else if (!flag2 && flag)
					{
						_selectedMasters.Remove(instance.master);
					}
				}
			}
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.SelectAll, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				foreach (PlayerCharacterMasterController instance2 in PlayerCharacterMasterController.instances)
				{
					if ((Object)(object)instance2 != (Object)null && (Object)(object)instance2.master != (Object)null)
					{
						_selectedMasters.Add(instance2.master);
					}
				}
			}
			if (GUILayout.Button(ModsL10n.SelectNone, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				_selectedMasters.Clear();
			}
			GUILayout.EndHorizontal();
			_selectedMasters.RemoveWhere((CharacterMaster m) => (Object)(object)m == (Object)null);
			GUILayout.Label(ModsL10n.PlayersAffectedFmt(_selectedMasters.Count), _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.Space(4f);
		}

		private static void DrawSection(string sectionId, Action body)
		{
			bool value;
			bool flag = _sectionExpanded.TryGetValue(sectionId, out value) && value;
			string text = (flag ? "▼" : "▶");
			string text2 = ModsL10n.SectionTitle(sectionId);
			if (GUILayout.Button("  " + text + "   " + text2, _sectionHeaderStyle, Array.Empty<GUILayoutOption>()))
			{
				_sectionExpanded[sectionId] = !flag;
			}
			if (flag)
			{
				GUILayout.BeginVertical(_sectionBoxStyle, Array.Empty<GUILayoutOption>());
				body();
				GUILayout.EndVertical();
			}
		}

		private static void ApplyToTargets(Action<CharacterMaster> action)
		{
			foreach (CharacterMaster item in new List<CharacterMaster>(_selectedMasters))
			{
				if (!((Object)(object)item == (Object)null))
				{
					action(item);
				}
			}
		}

		private static void DrawMoneySection()
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.BtnPlus1000, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.GiveMoney(m, 1000u);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnPlus10000, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.GiveMoney(m, 10000u);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnPlus100000, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.GiveMoney(m, 100000u);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.BtnMinus1000, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.TakeMoney(m, 1000u);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnMinus10000, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.TakeMoney(m, 10000u);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnMoneyResetZero, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetMoney(m, 0u);
				});
			}
			GUILayout.EndHorizontal();
		}

		private static void DrawHealthSection()
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.BtnGodmodeOn, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetGodMode(m, value: true);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnGodmodeOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetGodMode(m, value: false);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.BtnHealFull, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.HealFull(m);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnKill, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.Kill(m);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.BtnOneHp, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetHealthToOne(m);
				});
			}
			if (GUILayout.Button(ModsL10n.BtnHpTenPct, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetHealthFraction(m, 0.1f);
				});
			}
			GUILayout.EndHorizontal();
		}

		private static void DrawRunSection()
		{
			if (GUILayout.Button(ModsL10n.BtnNextStage, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				AdminActions.AdvanceToNextStage();
			}
		}

		private static void DrawMiscSection()
		{
			GUILayout.Label(ModsL10n.MiscInvisExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.MiscInvisibleOn, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetInvisible(m, value: true);
				});
			}
			if (GUILayout.Button(ModsL10n.MiscInvisibleOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetInvisible(m, value: false);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.Label(ModsL10n.MiscNoGravityLabel, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.MiscNoGravityOn, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetNoGravity(m, value: true);
				});
			}
			if (GUILayout.Button(ModsL10n.MiscNoGravityOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetNoGravity(m, value: false);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.Label(ModsL10n.MiscNoClipExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(ModsL10n.MiscNoClipInputs, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.MiscNoClipOn, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetNoClip(m, value: true);
				});
			}
			if (GUILayout.Button(ModsL10n.MiscNoClipOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetNoClip(m, value: false);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.Label(ModsL10n.MiscInstantSkillsExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.MiscInstantSkillsOn, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetInstantSkills(m, value: true);
				});
			}
			if (GUILayout.Button(ModsL10n.MiscInstantSkillsOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetInstantSkills(m, value: false);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.Label(ModsL10n.MiscDamageMultExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.MiscDamageOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetDamageMultiplier(m, 1f);
				});
			}
			if (GUILayout.Button("x5", _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetDamageMultiplier(m, 5f);
				});
			}
			if (GUILayout.Button("x100", _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetDamageMultiplier(m, 100f);
				});
			}
			if (GUILayout.Button(ModsL10n.MiscDamageInstakill, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetDamageMultiplier(m, 100000f);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.Label(ModsL10n.MiscAttackSpeedExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.MiscDamageOff, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetAttackSpeedMultiplier(m, 1f);
				});
			}
			if (GUILayout.Button("x2", _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetAttackSpeedMultiplier(m, 2f);
				});
			}
			if (GUILayout.Button("x5", _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetAttackSpeedMultiplier(m, 5f);
				});
			}
			if (GUILayout.Button("x10", _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.SetAttackSpeedMultiplier(m, 10f);
				});
			}
			GUILayout.EndHorizontal();
		}

		private static void DrawTeleportSection()
		{
			//IL_00cf: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Label(ModsL10n.TpExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.TpBtnTeleporter, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				if (AdminActions.TryGetTeleporterFootPosition(out var p2))
				{
					ApplyToTargets(delegate(CharacterMaster m)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						AdminActions.TeleportBodyToFootPosition(m, p2);
					});
				}
			}
			if (GUILayout.Button(ModsL10n.TpBtnSpawn, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				if (AdminActions.TryGetStageEntrySpawnFootPosition(out var p))
				{
					ApplyToTargets(delegate(CharacterMaster m)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						AdminActions.TeleportBodyToFootPosition(m, p);
					});
				}
			}
			GUILayout.EndHorizontal();
			CharacterMaster localMaster = AdminActions.GetLocalMaster();
			CharacterBody val = ((localMaster != null) ? localMaster.GetBody() : null);
			if ((Object)(object)val != (Object)null)
			{
				if (GUILayout.Button(ModsL10n.TpBtnToLocalHost, _buttonStyle, Array.Empty<GUILayoutOption>()))
				{
					Vector3 foot = val.footPosition;
					ApplyToTargets(delegate(CharacterMaster m)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						AdminActions.TeleportBodyToFootPosition(m, foot);
					});
				}
			}
			else
			{
				GUILayout.Label(ModsL10n.TpNoLocalBody, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			}
			GUILayout.Label(ModsL10n.TpToPlayerLiving, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			bool flag = false;
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				if ((Object)(object)((instance != null) ? instance.master : null) == (Object)null)
				{
					continue;
				}
				CharacterBody body = instance.master.GetBody();
				if ((Object)(object)body == (Object)null)
				{
					continue;
				}
				flag = true;
				if (GUILayout.Button(ModsL10n.TpTowardPlayerFmt(((Object)(object)instance.networkUser != (Object)null && !string.IsNullOrEmpty(instance.networkUser.userName)) ? instance.networkUser.userName : ModsL10n.PlayerFallback), _buttonStyle, Array.Empty<GUILayoutOption>()))
				{
					Vector3 destFoot = body.footPosition;
					ApplyToTargets(delegate(CharacterMaster m)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						AdminActions.TeleportBodyToFootPosition(m, destFoot);
					});
				}
			}
			if (!flag)
			{
				GUILayout.Label(ModsL10n.TpNoLivePlayers, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			}
		}

		private static void DrawInventorySection()
		{
			GUILayout.Label(ModsL10n.InvIntro, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button(ModsL10n.InvClearItems, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.ClearAllPermanentItems(m);
				});
			}
			if (GUILayout.Button(ModsL10n.InvClearEquipment, _buttonStyle, Array.Empty<GUILayoutOption>()))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					AdminActions.ClearAllEquipment(m);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			GUILayout.Label(ModsL10n.InvSearchExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			DrawInventorySearchRow();
			_invSubtractMode = GUILayout.Toggle(_invSubtractMode, ModsL10n.InvSubtractToggle, _toggleStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(ModsL10n.InvClickExplain, _targetInfoStyle, Array.Empty<GUILayoutOption>());
			EnsureInventoryTierFoldouts();
			GUILayout.Space(8f);
			DrawInventoryEquipmentPanel();
			GUILayout.Space(10f);
			GUILayout.Label(ModsL10n.InvItemsPerTier, _invTierHeaderStyle, Array.Empty<GUILayoutOption>());
			DrawInventoryItemsByTierPanel();
		}

		private static void DrawInventorySearchRow()
		{
			//IL_00a6: 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_00da: Invalid comparison between Unknown and I4
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Invalid comparison between Unknown and I4
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Invalid comparison between Unknown and I4
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (!_invSearchTyping)
			{
				string text = (_invSearchQuery ?? "").Trim();
				if (GUILayout.Button((text.Length == 0) ? ModsL10n.InvSearchPlaceholder : ModsL10n.InvSearchEditingFmt(text), _searchFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Height(28f),
					GUILayout.ExpandWidth(true)
				}))
				{
					_invSearchTyping = true;
					_invSearchFocusPending = true;
				}
			}
			else
			{
				GUI.SetNextControlName("StatsOverlay_AdminInvSearch");
				_invSearchQuery = GUI.TextField(GUILayoutUtility.GetRect(GUIContent.none, _searchFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Height(28f),
					GUILayout.ExpandWidth(true)
				}), _invSearchQuery ?? "", _searchFieldStyle);
				if (_invSearchFocusPending && (int)Event.current.type == 7)
				{
					GUI.FocusControl("StatsOverlay_AdminInvSearch");
					_invSearchFocusPending = false;
				}
				Event current = Event.current;
				if (_invSearchTyping && (int)current.type == 4 && (int)current.keyCode == 27)
				{
					_invSearchTyping = false;
					GUI.FocusControl("");
					current.Use();
				}
				if (GUILayout.Button(ModsL10n.BtnDone, _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(76f),
					GUILayout.Height(28f)
				}))
				{
					_invSearchTyping = false;
					GUI.FocusControl("");
				}
			}
			if (GUILayout.Button(ModsL10n.BtnClear, _buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(72f),
				GUILayout.Height(28f)
			}))
			{
				_invSearchQuery = "";
				_invSearchTyping = false;
				GUI.FocusControl("");
			}
			GUILayout.EndHorizontal();
		}

		private static void EnsureInventoryTierFoldouts()
		{
			//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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Invalid comparison between Unknown and I4
			if (_invTierFoldoutsInitialized)
			{
				return;
			}
			_invTierFoldoutsInitialized = true;
			foreach (ItemTier value in Enum.GetValues(typeof(ItemTier)))
			{
				if (!_invTierOpen.ContainsKey(value))
				{
					_invTierOpen[value] = (int)value == 0 || (int)value == 1;
				}
			}
		}

		private static void DrawInventoryEquipmentPanel()
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Invalid comparison between Unknown and I4
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button((_invEquipmentOpen ? "▼" : "▶") + "   " + ModsL10n.InvEquipFoldoutClosed, _sectionHeaderStyle, Array.Empty<GUILayoutOption>()))
			{
				_invEquipmentOpen = !_invEquipmentOpen;
			}
			GUILayout.EndHorizontal();
			if (!_invEquipmentOpen)
			{
				return;
			}
			GUILayout.BeginVertical(_sectionBoxStyle, Array.Empty<GUILayoutOption>());
			List<(EquipmentIndex, EquipmentDef)> list = new List<(EquipmentIndex, EquipmentDef)>();
			for (int i = 0; i < EquipmentCatalog.equipmentCount; i++)
			{
				EquipmentIndex val = (EquipmentIndex)i;
				if ((int)val == -1 || !EquipmentCatalog.IsIndexValid(ref val))
				{
					continue;
				}
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(val);
				if (!((Object)(object)equipmentDef == (Object)null))
				{
					string displayName = LocalizedEquipmentName(equipmentDef);
					string tokenHaystack = equipmentDef.nameToken + " " + equipmentDef.pickupToken;
					if (InventoryMatchesSearch(displayName, tokenHaystack))
					{
						list.Add((val, equipmentDef));
					}
				}
			}
			list.Sort(((EquipmentIndex ei, EquipmentDef def) a, (EquipmentIndex ei, EquipmentDef def) b) => string.Compare(LocalizedEquipmentName(a.def), LocalizedEquipmentName(b.def), StringComparison.OrdinalIgnoreCase));
			DrawEquipmentIconGridRows(list);
			GUILayout.EndVertical();
		}

		private static void DrawInventoryItemsByTierPanel()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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_0045: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<ItemTier, List<ItemDef>> dictionary = BuildFilteredItemsByTier();
			foreach (ItemTier item in OrderedInventoryTiers())
			{
				if (dictionary.TryGetValue(item, out var value) && value.Count != 0)
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					bool value2;
					bool flag = _invTierOpen.TryGetValue(item, out value2) && value2;
					if (GUILayout.Button(flag ? "▼" : "▶", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(26f) }))
					{
						_invTierOpen[item] = !flag;
					}
					GUILayout.Label($"{ModsL10n.TierLabel(item)}   ({value.Count})", _invTierHeaderStyle, Array.Empty<GUILayoutOption>());
					GUILayout.FlexibleSpace();
					GUILayout.EndHorizontal();
					if (_invTierOpen[item])
					{
						GUILayout.BeginVertical(_sectionBoxStyle, Array.Empty<GUILayoutOption>());
						DrawItemIconGridRows(value);
						GUILayout.EndVertical();
						GUILayout.Space(6f);
					}
				}
			}
		}

		private static Dictionary<ItemTier, List<ItemDef>> BuildFilteredItemsByTier()
		{
			//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)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<ItemTier, List<ItemDef>> dictionary = new Dictionary<ItemTier, List<ItemDef>>();
			Enumerator<ItemDef> enumerator = ItemCatalog.allItemDefs.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					ItemDef current = enumerator.Current;
					if ((Object)(object)current == (Object)null || current.hidden)
					{
						continue;
					}
					string displayName = LocalizedItemName(current);
					string tokenHaystack = current.nameToken + " " + current.pickupToken;
					if (InventoryMatchesSearch(displayName, tokenHaystack))
					{
						ItemTier tier = current.tier;
						if (!dictionary.TryGetValue(tier, out var value))
						{
							value = (dictionary[tier] = new List<ItemDef>());
						}
						value.Add(current);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			foreach (List<ItemDef> value2 in dictionary.Values)
			{
				value2.Sort((ItemDef a, ItemDef b) => string.Compare(LocalizedItemName(a), LocalizedItemName(b), StringComparison.OrdinalIgnoreCase));
			}
			return dictionary;
		}

		[IteratorStateMachine(typeof(<OrderedInventoryTiers>d__47))]
		private static IEnumerable<ItemTier> OrderedInventoryTiers()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OrderedInventoryTiers>d__47(-2);
		}

		private static bool InventoryMatchesSearch(string displayName, string tokenHaystack)
		{
			string text = (_invSearchQuery ?? "").Trim();
			if (text.Length == 0)
			{
				return true;
			}
			text = text.ToLowerInvariant();
			if (!(displayName ?? "").ToLowerInvariant().Contains(text))
			{
				return (tokenHaystack ?? "").ToLowerInvariant().Contains(text);
			}
			return true;
		}

		private static void DrawInventorySprite(Rect r, Sprite sprite)
		{
			//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)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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)
			Texture texture = (Texture)(object)sprite.texture;
			Rect textureRect = sprite.textureRect;
			float num = texture.width;
			float num2 = texture.height;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(((Rect)(ref textureRect)).x / num, ((Rect)(ref textureRect)).y / num2, ((Rect)(ref textureRect)).width / num, ((Rect)(ref textureRect)).height / num2);
			Color color = GUI.color;
			GUI.color = Color.white;
			GUI.DrawTextureWithTexCoords(r, texture, val);
			GUI.color = color;
		}

		private static void InventoryItemIconCell(ItemDef def)
		{
			//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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Invalid comparison between Unknown and I4
			//IL_00c4: 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)
			//IL_00db: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(48f, 48f, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(false),
				GUILayout.ExpandHeight(false)
			});
			Sprite pickupIconSprite = def.pickupIconSprite;
			bool flag = (Object)(object)pickupIconSprite != (Object)null && (Object)(object)pickupIconSprite.texture != (Object)null;
			if ((int)Event.current.type == 7)
			{
				GUI.Box(rect, (GUIContent)(flag ? ((object)GUIContent.none) : ((object)new GUIContent("?"))), _invIconSlotStyle);
				if (flag)
				{
					DrawInventorySprite(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), pickupIconSprite);
				}
			}
			string text = LocalizedItemName(def);
			if (!GUI.Button(rect, new GUIContent("", text), GUIStyle.none))
			{
				return;
			}
			ItemIndex ix = def.itemIndex;
			if (_invSubtractMode)
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					AdminActions.RemoveItem(m, ix, 1);
				});
			}
			else
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					AdminActions.GiveItem(m, ix, 1);
				});
			}
		}

		private static void InventoryEquipmentIconCell(EquipmentIndex ei, EquipmentDef edef)
		{
			//IL_0007: 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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0060: Invalid comparison between Unknown and I4
			//IL_00cb: 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_00e2: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(48f, 48f, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(false),
				GUILayout.ExpandHeight(false)
			});
			Sprite pickupIconSprite = edef.pickupIconSprite;
			bool flag = (Object)(object)pickupIconSprite != (Object)null && (Object)(object)pickupIconSprite.texture != (Object)null;
			if ((int)Event.current.type == 7)
			{
				GUI.Box(rect, (GUIContent)(flag ? ((object)GUIContent.none) : ((object)new GUIContent("?"))), _invIconSlotStyle);
				if (flag)
				{
					DrawInventorySprite(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), pickupIconSprite);
				}
			}
			string text = LocalizedEquipmentName(edef);
			if (GUI.Button(rect, new GUIContent("", text), GUIStyle.none))
			{
				ApplyToTargets(delegate(CharacterMaster m)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					AdminActions.GiveEquipment(m, ei);
				});
			}
		}

		private static void DrawItemIconGridRows(List<ItemDef> list)
		{
			for (int i = 0; i < list.Count; i += 8)
			{
				GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinHeight(48f) });
				int num = Mathf.Min(i + 8, list.Count);
				for (int j = i; j < num; j++)
				{
					InventoryItemIconCell(list[j]);
				}
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
				GUILayout.Space(4f);
			}
		}

		private static void DrawEquipmentIconGridRows(List<(EquipmentIndex ei, EquipmentDef def)> rows)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < rows.Count; i += 8)
			{
				GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinHeight(48f) });
				int num = Mathf.Min(i + 8, rows.Count);
				for (int j = i; j < num; j++)
				{
					(EquipmentIndex, EquipmentDef) tuple = rows[j];
					InventoryEquipmentIconCell(tuple.Item1, tuple.Item2);
				}
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
				GUILayout.Space(4f);
			}
		}

		private static string LocalizedItemName(ItemDef def)
		{
			if ((Object)(object)def == (Object)null)
			{
				return "?";
			}
			string[] array = new string[2] { def.pickupToken, def.nameToken };
			foreach (string text in array)
			{
				if (!string.IsNullOrEmpty(text))
				{
					string @string = Language.GetString(text);
					if (!string.IsNullOrEmpty(@string))
					{
						return @string;
					}
				}
			}
			return ((Object)def).name;
		}

		private static string LocalizedEquipmentName(EquipmentDef def)
		{
			if ((Object)(object)def == (Object)null)
			{
				return "?";
			}
			string[] array = new string[2] { def.pickupToken, def.nameToken };
			foreach (string text in array)
			{
				if (!string.IsNullOrEmpty(text))
				{
					string @string = Language.GetString(text);
					if (!string.IsNullOrEmpty(@string))
					{
						return @string;
					}
				}
			}
			return ((Object)def).name;
		}
	}
	internal static class ModsL10n
	{
		internal const string SecMoney = "money";

		internal const string SecHealth = "health";

		internal const string SecMisc = "misc";

		internal const string SecRun = "run";

		internal const string SecTeleport = "teleport";

		internal const string SecInventory = "inventory";

		public static bool IsFrench
		{
			get
			{
				string text = Language.currentLanguageName ?? "";
				if (text.Length == 0)
				{
					return false;
				}
				return text.StartsWith("FR", StringComparison.OrdinalIgnoreCase);
			}
		}

		public static string HudHighlightOn => Lang("Highlight ON", "● Highlight ON");

		public static string AdminWindowTitle => Lang("Admin Panel — Host only", "Admin — réservé à l'hôte");

		public static string TargetHeading => Lang("Targets", "Cible");

		public static string PlayerFallback => Lang("Player", "Joueur");

		public static string YouSuffix => Lang(" (you)", " (toi)");

		public static string SelectAll => Lang("All", "Tous");

		public static string SelectNone => Lang("None", "Aucun");

		public static string BtnPlus1000 => Lang("+$1,000", "+1 000$");

		public static string BtnPlus10000 => Lang("+$10,000", "+10 000$");

		public static string BtnPlus100000 => Lang("+$100,000", "+100 000$");

		public static string BtnMinus1000 => Lang("-$1,000", "-1 000$");

		public static string BtnMinus10000 => Lang("-$10,000", "-10 000$");

		public static string BtnMoneyResetZero => Lang("Reset to $0", "Reset à 0$");

		public static string BtnGodmodeOn => Lang("God mode ON", "Godmode ON");

		public static string BtnGodmodeOff => Lang("God mode OFF", "Godmode OFF");

		public static string BtnHealFull => Lang("Heal fully", "Soigner 100%");

		public static string BtnKill => Lang("Kill", "Tuer");

		public static string BtnOneHp => Lang("1 HP", "1 HP");

		public static string BtnHpTenPct => Lang("Set HP to 10%", "HP à 10%");

		public static string BtnNextStage => Lang("Next stage", "Stage suivant");

		public static string MiscInvisExplain => Lang("Invisibility: Intangible buff (synced): enemies ignore you; meshes hidden for everyone locally.", "Invisibilité : buff Intangible (répliqué) — ennemis ignorent + meshes masqués pour tous.");

		public static string MiscNoGravityLabel => Lang("No gravity", "No gravity");

		public static string MiscNoGravityOn => Lang("No gravity ON", "No gravity ON");

		public static string MiscNoGravityOff => Lang("No gravity OFF", "No gravity OFF");

		public static string MiscNoClipExplain => Lang("No clip: free fly through walls.", "No clip (vol libre, traverse les murs)");

		public static string MiscNoClipInputs => Lang("Target player inputs on this PC: WASD + jump/up, sprint to move faster, C to move down.", "Entrées du joueur ciblé : WASD + saut (↑), sprint plus vite ; touche C pour descendre (sur cette machine si tu contrôles ce perso ; coop distant : entrée « bas » répliquée).");

		public static string MiscNoClipOn => Lang("No clip ON", "No clip ON");

		public static string MiscNoClipOff => Lang("No clip OFF", "No clip OFF");

		public static string MiscInstantSkillsExplain => Lang("Skills ignore cooldown timers.", "Compétences sans cooldown");

		public static string MiscInstantSkillsOn => Lang("Instant skills ON", "Instant skills ON");

		public static string MiscInstantSkillsOff => Lang("Instant skills OFF", "Instant skills OFF");

		public static string MiscDamageMultExplain => Lang("Outgoing damage multiplier", "Multiplicateur de dégâts");

		public static string MiscDamageOff => Lang("x1 (off)", "x1 (off)");

		public static string MiscDamageInstakill => Lang("Insta-kill", "Insta-kill");

		public static string MiscAttackSpeedExplain => Lang("Attack speed multiplier (applied after stat calculation)", "Multiplicateur de vitesse d'attaque (après calcul des stats)");

		public static string MiscInvisibleOn => Lang("Invisible ON", "Invisible ON");

		public static string MiscInvisibleOff => Lang("Invisible OFF", "Invisible OFF");

		public static string TpExplain => Lang("Players checked under \"Targets\" are moved on the server. A living body is required; ignored if teleport or spawn is missing on this stage.", "Les joueurs cochés dans « Cible » sont déplacés (serveur). Perso vivant requis. Si le téléporteur ou le spawn n'existe pas encore sur ce stage, le clic est ignoré.");

		public static string TpBtnTeleporter => Lang("Go to teleporter", "Vers téléporteur");

		public static string TpBtnSpawn => Lang("Go to entrance spawn", "Vers spawn d'entrée");

		public static string TpBtnToLocalHost => Lang("Toward me (local player / host)", "Vers moi (joueur local / hôte)");

		public static string TpNoLocalBody => Lang("Toward me: no body for local player (menu or spectator).", "Vers moi : pas de corps pour le joueur local (menu ou spectateur).");

		public static string TpToPlayerLiving => Lang("Go to position of another living player:", "Vers la position d'un joueur vivant :");

		public static string TpNoLivePlayers => Lang("No player with body on this stage.", "Aucun joueur avec corps sur ce stage.");

		public static string InvIntro => Lang("Permanent items and equipment — synced to selected players.", "Objets permanents et équipement — répliqués aux joueurs sélectionnés.");

		public static string InvClearItems => Lang("Clear all items", "Vider tous les items");

		public static string InvClearEquipment => Lang("Remove equipment", "Retirer équipement");

		public static string InvSearchExplain => Lang("Search: keys go to gameplay by default — click below to filter by name/token. Blank = show all. Esc or Done returns keys.", "Recherche : par défaut le clavier va au jeu — clique la zone ci-dessous pour taper un filtre (nom ou token). Vide = tout afficher. Échap ou « Terminer » rend les touches au jeu.");

		public static string InvSubtractToggle => Lang("Subtract mode: click item icon = −1 stack", "Mode retirer : clic sur une icône d'item = −1 stack");

		public static string InvClickExplain => Lang("Items: click icon = +1 (−1 in subtract mode). Equipment: replaces active. Hover for tooltip name.", "Items : clic sur l'icône = +1 (ou −1 si mode retirer). Équipements : clic = donner (remplace l'actif). Survole une icône pour le nom.");

		public static string InvItemsPerTier => Lang("Items by tier", "Items par tier");

		public static string InvEquipFoldoutClosed => Lang("Equipment", "Équipements");

		public static string InvSearchPlaceholder => Lang("Filter… (click to capture keyboard)", "Filtrer… (clique ici pour activer le clavier)");

		public static string BtnDone => Lang("Done", "Terminer");

		public static string BtnClear => Lang("Clear", "Effacer");

		public static string Lang(string english, string french)
		{
			if (!IsFrench)
			{
				return english;
			}
			return french;
		}

		public static string SectionTitle(string sectionId)
		{
			return sectionId switch
			{
				"money" => Lang("Money", "Argent"), 
				"health" => Lang("Health", "Santé"), 
				"misc" => Lang("Misc (combat / movement)", "Misc (combat / mouvement)"), 
				"run" => "Run", 
				"teleport" => Lang("Teleportation", "Téléportation"), 
				"inventory" => Lang("Inventory", "Inventaire"), 
				_ => sectionId, 
			};
		}

		public static string HudGoldTotal(ulong amount)
		{
			return Lang($"Total gold: ${amount}", $"Argent total : ${amount}");
		}

		public static string HudChests(int n)
		{
			return Lang($"Chests: {n}", $"Coffres : {n}");
		}

		public static string HudEquipment(int n)
		{
			return Lang($"Equipment barrels: {n}", $"Équipements : {n}");
		}

		public static string HudShops(int n)
		{
			return Lang($"Triple shops: {n}", $"Shops : {n}");
		}

		public static string HudRobotsRepair(int n)
		{
			return Lang($"Drones/turrets to repair: {n}", $"Robots à réparer : {n}");
		}

		public static string PlayersAffectedFmt(int count)
		{
			return Lang($"→ {count} player(s) affected", $"→ {count} joueur(s) affecté(s)");
		}

		public static string TpTowardPlayerFmt(string name)
		{
			return Lang("Toward \"" + Trunc(name, 22) + "\"", "Vers « " + Trunc(name, 22) + " »");
		}

		public static string InvSearchEditingFmt(string q)
		{
			return Lang("\"" + Trunc(q, 36) + "\" — click to edit", "« " + Trunc(q, 36) + " » — clique pour modifier");
		}

		public static string TierLabel(ItemTier tier)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected I4, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			switch ((int)tier)
			{
			default:
				if ((int)tier == 1000)
				{
					return Lang("Runtime tier", "Tier dynamique");
				}
				return ((object)(ItemTier)(ref tier)).ToString();
			case 0:
				return Lang("White", "Blanc");
			case 1:
				return Lang("Green", "Vert");
			case 2:
				return Lang("Red", "Rouge");
			case 4:
				return "Boss";
			case 3:
				return Lang("Lunar", "Lunaire");
			case 5:
				return Lang("No tier", "Sans tier");
			case 6:
				return Lang("Void — white", "Void — blanc");
			case 7:
				return Lang("Void — green", "Void — vert");
			case 8:
				return Lang("Void — red", "Void — rouge");
			case 9:
				return Lang("Void — boss", "Void — boss");
			case 10:
				return Lang("Food", "Nourriture");
			}
		}

		public static string Trunc(string s, int maxChars)
		{
			if (string.IsNullOrEmpty(s))
			{
				return "";
			}
			if (s.Length > maxChars)
			{
				return s.Substring(0, maxChars - 1) + "…";
			}
			return s;
		}
	}
	[BepInPlugin("com.bardown.statsoverlay", "StatsOverlay", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_RecalculateStats <0>__CharacterBody_RecalculateStats_AttackSpeedAdmin;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_TakeDamage <>9__10_0;

			internal void <Awake>b__10_0(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
			{
				if (damageInfo != null && (Object)(object)damageInfo.attacker != (Object)null)
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					if ((Object)(object)component != (Object)null && (Object)(object)component.master != (Object)null && AdminActions.DamageMultMasters.TryGetValue(component.master, out var value))
					{
						damageInfo.damage *= value;
					}
				}
				orig.Invoke(self, damageInfo);
			}
		}

		public const string PluginGuid = "com.bardown.statsoverlay";

		private static readonly Dictionary<Highlight, (HighlightColor color, Color custom)> _overridden = new Dictionary<Highlight, (HighlightColor, Color)>();

		private static readonly HashSet<Highlight> _currentFrameSet = new HashSet<Highlight>();

		private static readonly List<Highlight> _toRestore = new List<Highlight>();

		private static FieldRef<CharacterBody, float> _attackSpeedBackingField;

		private static bool _attackSpeedHackReady;

		public static bool HighlightAllOn { get; private set; }

		private void Awake()
		{
			//IL_005e: 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_0069: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0} v{1} {2}", ((BaseUnityPlugin)this).Info.Metadata.Name, ((BaseUnityPlugin)this).Info.Metadata.Version, ModsL10n.Lang("loaded.", "chargé.")));
			TryWireAttackSpeedHack();
			object obj = <>c.<>9__10_0;
			if (obj == null)
			{
				hook_TakeDamage val = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
				{
					if (damageInfo != null && (Object)(object)damageInfo.attacker != (Object)null)
					{
						CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
						if ((Object)(object)component != (Object)null && (Object)(object)component.master != (Object)null && AdminActions.DamageMultMasters.TryGetValue(component.master, out var value))
						{
							damageInfo.damage *= value;
						}
					}
					orig.Invoke(self, damageInfo);
				};
				<>c.<>9__10_0 = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj;
		}

		private void TryWireAttackSpeedHack()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			try
			{
				_attackSpeedBackingField = AccessTools.FieldRefAccess<CharacterBody, float>("<attackSpeed>k__BackingField");
				object obj = <>O.<0>__CharacterBody_RecalculateStats_AttackSpeedAdmin;
				if (obj == null)
				{
					hook_RecalculateStats val = CharacterBody_RecalculateStats_AttackSpeedAdmin;
					<>O.<0>__CharacterBody_RecalculateStats_AttackSpeedAdmin = val;
					obj = (object)val;
				}
				CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
				_attackSpeedHackReady = true;
				((BaseUnityPlugin)this).Logger.LogInfo((object)ModsL10n.Lang("StatsOverlay: attack speed bonus (after RecalculateStats) enabled.", "StatsOverlay : bonus vitesse d'attaque admin (post RecalculateStats) actif."));
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)(ModsL10n.Lang("StatsOverlay: attack speed bonus disabled", "StatsOverlay : bonus vitesse d'attaque désactivé") + " (" + ex.Message + ")"));
			}
		}

		private static void CharacterBody_RecalculateStats_AttackSpeedAdmin(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (_attackSpeedHackReady && !((Object)(object)self.master == (Object)null) && AdminActions.AttackSpeedMultMasters.TryGetValue(self.master, out var value) && !(value <= 1f))
			{
				_attackSpeedBackingField.Invoke(self) *= value;
			}
		}

		private void FixedUpdate()
		{
			AdminActions.Tick();
		}

		private void LateUpdate()
		{
			AdminActions.SyncInvisibleVisuals();
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)283))
			{
				HighlightAllOn = !HighlightAllOn;
				((BaseUnityPlugin)this).Logger.LogInfo((object)("[Highlight] " + (HighlightAllOn ? "ON" : "OFF")));
			}
			bool num = Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305);
			bool flag = Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303);
			if (num && flag && Input.GetKeyDown((KeyCode)100))
			{
				AdminPanel.Toggle();
			}
			UpdateHighlights();
		}

		private static void UpdateHighlights()
		{
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			_currentFrameSet.Clear();
			if (HighlightAllOn && (Object)(object)Run.instance != (Object)null)
			{
				foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList<PurchaseInteraction>())
				{
					if (!((Object)(object)instances == (Object)null) && instances.available)
					{
						CollectHighlights(((Component)instances).gameObject, _currentFrameSet);
					}
				}
				foreach (BarrelInteraction instances2 in InstanceTracker.GetInstancesList<BarrelInteraction>())
				{
					if (!((Object)(object)instances2 == (Object)null) && !instances2.Networkopened)
					{
						CollectHighlights(((Component)instances2).gameObject, _currentFrameSet);
					}
				}
			}
			_toRestore.Clear();
			foreach (KeyValuePair<Highlight, (HighlightColor, Color)> item in _overridden)
			{
				if ((Object)(object)item.Key == (Object)null || !_currentFrameSet.Contains(item.Key))
				{
					_toRestore.Add(item.Key);
				}
			}
			foreach (Highlight item2 in _toRestore)
			{
				if ((Object)(object)item2 != (Object)null && _overridden.TryGetValue(item2, out (HighlightColor, Color) value))
				{
					item2.highlightColor = value.Item1;
					item2.CustomColor = value.Item2;
					item2.isOn = false;
				}
				_overridden.Remove(item2);
			}
			foreach (Highlight item3 in _currentFrameSet)
			{
				if (!((Object)(object)item3 == (Object)null))
				{
					if (!_overridden.ContainsKey(item3))
					{
						_overridden[item3] = (item3.highlightColor, item3.CustomColor);
					}
					item3.isOn = true;
					item3.highlightColor = (HighlightColor)3;
					item3.CustomColor = Color.yellow;
				}
			}
		}

		private static void CollectHighlights(GameObject go, HashSet<Highlight> set)
		{
			Highlight[] componentsInChildren = go.GetComponentsInChildren<Highlight>(true);
			foreach (Highlight val in componentsInChildren)
			{
				if ((Object)(object)val != (Object)null)
				{
					set.Add(val);
				}
			}
		}

		private void OnGUI()
		{
			StatsHud.Draw();
			AdminPanel.Draw();
		}
	}
	public static class StatsHud
	{
		private static GUIStyle _labelStyle;

		private static GUIStyle _boxStyle;

		private static Texture2D _bgTexture;

		private static void EnsureStyles()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			//IL_0071: 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_0084: Expected O, but got Unknown
			//IL_0089: Expected O, but got Unknown
			//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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_00c6: Expected O, but got Unknown
			//IL_00cb: Expected O, but got Unknown
			if (_labelStyle == null)
			{
				_bgTexture = new Texture2D(1, 1);
				_bgTexture.SetPixel(0, 0, new Color(0f, 0f, 0f, 0.55f));
				_bgTexture.Apply();
				GUIStyle val = new GUIStyle(GUI.skin.box);
				val.normal.background = _bgTexture;
				val.border = new RectOffset(0, 0, 0, 0);
				val.padding = new RectOffset(12, 12, 10, 10);
				_boxStyle = val;
				GUIStyle val2 = new GUIStyle(GUI.skin.label)
				{
					fontSize = 15,
					fontStyle = (FontStyle)1
				};
				val2.normal.textColor = Color.white;
				val2.padding = new RectOffset(0, 0, 1, 1);
				_labelStyle = val2;
			}
		}

		public static void Draw()
		{
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Run.instance == (Object)null)
			{
				return;
			}
			LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
			if ((Object)(object)((firstLocalUser != null) ? firstLocalUser.cachedMaster : null) == (Object)null)
			{
				return;
			}
			EnsureStyles();
			ulong amount = 0uL;
			PlayerStatsComponent playerStatsComponent = firstLocalUser.cachedMaster.playerStatsComponent;
			if ((Object)(object)playerStatsComponent != (Object)null && playerStatsComponent.currentStats != null)
			{
				amount = playerStatsComponent.currentStats.GetStatValueULong(StatDef.goldCollected);
			}
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			int num4 = 0;
			HashSet<MultiShopController> hashSet = new HashSet<MultiShopController>();
			foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList<PurchaseInteraction>())
			{
				if (!instances.available)
				{
					continue;
				}
				string text = instances.displayNameToken ?? "";
				if ((Object)(object)((Component)instances).GetComponent<SummonMasterBehavior>() != (Object)null)
				{
					num3++;
				}
				else if ((Object)(object)((Component)instances).GetComponent<ShopTerminalBehavior>() != (Object)null)
				{
					MultiShopController componentInParent = ((Component)instances).GetComponentInParent<MultiShopController>();
					if ((Object)(object)componentInParent != (Object)null)
					{
						if (hashSet.Add(componentInParent))
						{
							num4++;
						}
					}
					else
					{
						num4++;
					}
				}
				else if (text.Contains("EQUIPMENT") || text.Contains("BARREL"))
				{
					num2++;
				}
				else if ((Object)(object)((Component)instances).GetComponent<ChestBehavior>() != (Object)null || (Object)(object)((Component)instances).GetComponent<RouletteChestController>() != (Object)null || (Object)(object)((Component)instances).GetComponent<OptionChestBehavior>() != (Object)null)
				{
					num++;
				}
			}
			bool highlightAllOn = Plugin.HighlightAllOn;
			float num5 = (highlightAllOn ? 175 : 150);
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(10f, 10f, 240f, num5);
			GUI.Box(val, GUIContent.none, _boxStyle);
			GUILayout.BeginArea(new Rect(((Rect)(ref val)).x + 12f, ((Rect)(ref val)).y + 10f, ((Rect)(ref val)).width - 24f, ((Rect)(ref val)).height - 20f));
			GUILayout.Label(ModsL10n.HudGoldTotal(amount), _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(ModsL10n.HudChests(num), _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(ModsL10n.HudEquipment(num2), _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(ModsL10n.HudShops(num4), _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(ModsL10n.HudRobotsRepair(num3), _labelStyle, Array.Empty<GUILayoutOption>());
			if (highlightAllOn)
			{
				GUILayout.Label(ModsL10n.HudHighlightOn, _labelStyle, Array.Empty<GUILayoutOption>());
			}
			GUILayout.EndArea();
		}
	}
}