Decompiled source of MineMogulModMenu v1.2.0

MineMogulModMenu.dll

Decompiled 6 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MineMogulModMenu")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b3c7ae495be143b0aa44351f60df8f8835c84cc3")]
[assembly: AssemblyProduct("MineMogulModMenu")]
[assembly: AssemblyTitle("MineMogulModMenu")]
[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 MineMogulModMenu
{
	public class Config
	{
		public class PolishingMachineConfig
		{
			public bool IgnoreDirtyOres = false;
		}

		public class EconomyConfig
		{
			public string AddMoney = "500";
		}

		public class ResearchConfig
		{
			public string AddTickets = "10";
		}

		public class MinerConfig
		{
			public bool HighlightSelected = true;

			public int SelectedIndex = 0;

			public float SpawnRate = 1f;
		}

		public class FurnacesConfig
		{
			public bool HighlightSelected = true;

			public float ProcessingTime = 1f;

			public int SelectedIndex = 0;
		}

		public class DepositBoxConfig
		{
			public bool InstantSell = false;
		}

		public class PlayerConfig
		{
			public bool Noclip = false;

			public float NoclipSpeed = 20f;

			public float WalkSpeed = 4f;

			public float SprintSpeed = 6f;

			public float JumpHeight = 2f;
		}

		public class SettingsConfig
		{
			public Color MinerHighlightColor = Color.blue;

			public Color FurnaceHighlightColor = Color.orangeRed;

			public bool HighlightThroughWalls = true;
		}

		public static Config Instance { get; } = new Config();


		public MinerConfig Miners { get; } = new MinerConfig();


		public PlayerConfig Player { get; } = new PlayerConfig();


		public FurnacesConfig Furnaces { get; } = new FurnacesConfig();


		public DepositBoxConfig DepositBox { get; } = new DepositBoxConfig();


		public EconomyConfig Economy { get; } = new EconomyConfig();


		public ResearchConfig Research { get; } = new ResearchConfig();


		public PolishingMachineConfig PolishingMachine { get; } = new PolishingMachineConfig();


		public SettingsConfig Settings { get; } = new SettingsConfig();

	}
	public enum DrawType
	{
		BoundingBox
	}
	public struct DrawingEntry
	{
		public DrawType DrawType;

		public Renderer[] Renderers;

		public Color Color;

		public DrawingEntry(DrawType drawType, Renderer[] renderers, Color color)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			DrawType = drawType;
			Renderers = renderers;
			Color = color;
		}
	}
	public class DrawingManager : MonoBehaviour
	{
		public static List<DrawingEntry> NextDrawEntries = new List<DrawingEntry>();

		private Material mat;

		private void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			mat = new Material(Shader.Find("Hidden/Internal-Colored"));
			mat.SetInt("_ZTest", 8);
		}

		private void DrawBounds(Bounds b)
		{
			//IL_0003: 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_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0065: 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_0077: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: 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_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: 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_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: 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)
			Vector3 min = ((Bounds)(ref b)).min;
			Vector3 max = ((Bounds)(ref b)).max;
			GL.Vertex3(min.x, min.y, min.z);
			GL.Vertex3(max.x, min.y, min.z);
			GL.Vertex3(max.x, min.y, min.z);
			GL.Vertex3(max.x, min.y, max.z);
			GL.Vertex3(max.x, min.y, max.z);
			GL.Vertex3(min.x, min.y, max.z);
			GL.Vertex3(min.x, min.y, max.z);
			GL.Vertex3(min.x, min.y, min.z);
			GL.Vertex3(min.x, max.y, min.z);
			GL.Vertex3(max.x, max.y, min.z);
			GL.Vertex3(max.x, max.y, min.z);
			GL.Vertex3(max.x, max.y, max.z);
			GL.Vertex3(max.x, max.y, max.z);
			GL.Vertex3(min.x, max.y, max.z);
			GL.Vertex3(min.x, max.y, max.z);
			GL.Vertex3(min.x, max.y, min.z);
			GL.Vertex3(min.x, min.y, min.z);
			GL.Vertex3(min.x, max.y, min.z);
			GL.Vertex3(max.x, min.y, min.z);
			GL.Vertex3(max.x, max.y, min.z);
			GL.Vertex3(max.x, min.y, max.z);
			GL.Vertex3(max.x, max.y, max.z);
			GL.Vertex3(min.x, min.y, max.z);
			GL.Vertex3(min.x, max.y, max.z);
		}

		private void OnRenderObject()
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			Camera current = Camera.current;
			if ((Object)(object)current == (Object)null || (Object)(object)current != (Object)(object)Camera.main)
			{
				return;
			}
			if (Config.Instance.Settings.HighlightThroughWalls)
			{
				mat.SetPass(0);
			}
			GL.PushMatrix();
			GL.Begin(1);
			foreach (DrawingEntry nextDrawEntry in NextDrawEntries)
			{
				if (nextDrawEntry.Renderers.Count() <= 0)
				{
					continue;
				}
				GL.Color(nextDrawEntry.Color);
				if (nextDrawEntry.DrawType != 0)
				{
					continue;
				}
				Renderer[] renderers = nextDrawEntry.Renderers;
				foreach (Renderer val in renderers)
				{
					if (Object.op_Implicit((Object)(object)val))
					{
						DrawBounds(val.bounds);
					}
				}
			}
			NextDrawEntries.Clear();
			GL.End();
			GL.PopMatrix();
		}
	}
	public class FurnaceModManager : MonoBehaviour
	{
		public static int SelectedFurnaceIndex;

		private static BlastFurnace selectedFurnace;

		public static BlastFurnace GetFurnaceByIndex(int index)
		{
			if (index >= 0 && index < GameUtilities.Furnaces.Count)
			{
				return GameUtilities.Furnaces[index];
			}
			return null;
		}

		private void Update()
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			selectedFurnace = GameUtilities.Furnaces.Where((BlastFurnace furnace, int index) => index == Config.Instance.Furnaces.SelectedIndex).FirstOrDefault();
			if (!Config.Instance.Furnaces.HighlightSelected)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)selectedFurnace))
			{
				DrawingManager.NextDrawEntries.Add(new DrawingEntry
				{
					DrawType = DrawType.BoundingBox,
					Renderers = (Renderer[])(object)new Renderer[1] { ((Component)selectedFurnace).GetComponent<Renderer>() },
					Color = Config.Instance.Settings.FurnaceHighlightColor
				});
			}
			else
			{
				DrawingManager.NextDrawEntries.Add(new DrawingEntry
				{
					DrawType = DrawType.BoundingBox,
					Renderers = GameUtilities.Furnaces.Select((BlastFurnace f) => ((Component)f).GetComponent<Renderer>()).ToArray(),
					Color = Config.Instance.Settings.FurnaceHighlightColor
				});
			}
		}

		public static void ApplyProcessingTime(float processingTIme)
		{
			if ((Object)(object)selectedFurnace == (Object)null)
			{
				GameUtilities.Furnaces.ForEach(delegate(BlastFurnace furnace)
				{
					furnace.ProcessingTime = processingTIme;
				});
			}
			else if ((Object)(object)selectedFurnace != (Object)null)
			{
				selectedFurnace.ProcessingTime = processingTIme;
			}
		}
	}
	[HarmonyPatch(typeof(UIManager), "IsInAnyMenu")]
	public class MenuPatch
	{
		private static void Postfix(ref bool __result)
		{
			__result = Plugin.MenuComponent.ShowMenu | __result;
		}
	}
	[HarmonyPatch(typeof(OrePiece), "DelayThenSell")]
	public class OreSellDelayPatch
	{
		private static bool Prefix(ref float delayBeforeSelling)
		{
			delayBeforeSelling = (Config.Instance.DepositBox.InstantSell ? 0f : delayBeforeSelling);
			return true;
		}
	}
	[HarmonyPatch(typeof(PolishingMachine), "MakeDirty")]
	public class DirtyOrePatch
	{
		private static bool Prefix()
		{
			return !Config.Instance.PolishingMachine.IgnoreDirtyOres;
		}
	}
	public class GameUtilities : MonoBehaviour
	{
		private static PlayerController _localPlayerController;

		private static EconomyManager _economyManager;

		private static QuestManager _questManager;

		private static ResearchManager _researchManager;

		private static DepositBox _depositBox;

		private static List<AutoMiner> _autoMiners;

		private static List<BlastFurnace> _furnaces;

		private static float _lastAutoMinerRefreshTime;

		private static float _lastFurnanceRefreshTime;

		private const float RefreshInterval = 0.5f;

		public static List<BlastFurnace> Furnaces
		{
			get
			{
				if (_furnaces == null || Time.time - _lastFurnanceRefreshTime > 0.5f)
				{
					_furnaces = Object.FindObjectsByType<BlastFurnace>((FindObjectsInactive)0, (FindObjectsSortMode)0).ToList();
					_lastFurnanceRefreshTime = Time.time;
				}
				return _furnaces;
			}
		}

		public static List<AutoMiner> AutoMiners
		{
			get
			{
				if (_autoMiners == null || Time.time - _lastAutoMinerRefreshTime > 0.5f)
				{
					_autoMiners = Object.FindObjectsByType<AutoMiner>((FindObjectsInactive)0, (FindObjectsSortMode)0).ToList();
					_lastAutoMinerRefreshTime = Time.time;
				}
				return _autoMiners;
			}
		}

		public static PlayerController LocalPlayerController
		{
			get
			{
				if ((Object)(object)_localPlayerController == (Object)null)
				{
					_localPlayerController = Object.FindFirstObjectByType<PlayerController>();
				}
				return _localPlayerController;
			}
		}

		public static QuestManager QuestManager
		{
			get
			{
				if ((Object)(object)_questManager == (Object)null)
				{
					_questManager = Object.FindFirstObjectByType<QuestManager>();
				}
				return _questManager;
			}
		}

		public static ResearchManager ResearchManager
		{
			get
			{
				if ((Object)(object)_researchManager == (Object)null)
				{
					_researchManager = Object.FindFirstObjectByType<ResearchManager>();
				}
				return _researchManager;
			}
		}

		public static DepositBox DepositBox
		{
			get
			{
				if ((Object)(object)_depositBox == (Object)null)
				{
					_depositBox = Object.FindFirstObjectByType<DepositBox>();
				}
				return _depositBox;
			}
		}

		public static EconomyManager EconomyManager
		{
			get
			{
				if ((Object)(object)_economyManager == (Object)null)
				{
					_economyManager = Object.FindFirstObjectByType<EconomyManager>();
				}
				return _economyManager;
			}
		}

		private void Awake()
		{
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			Reset();
		}

		public static void Reset()
		{
			_localPlayerController = null;
			_economyManager = null;
			_depositBox = null;
			_questManager = null;
		}
	}
	public enum MenuTab
	{
		Player,
		Research,
		Economy,
		World,
		Quests,
		Settings
	}
	public enum SubMenuTab
	{
		Miners,
		PolishingMachine,
		Furnaces,
		DepositBox,
		Detonators
	}
	public class Menu : MonoBehaviour
	{
		private Rect windowRect = new Rect(100f, 100f, 950f, 750f);

		public MenuTab CurrentTab { get; private set; }

		public SubMenuTab CurrentSubTab { get; private set; }

		public bool ShowMenu { get; private set; }

		private void Start()
		{
			Object.DontDestroyOnLoad((Object)(object)this);
			CurrentTab = MenuTab.Player;
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)282))
			{
				ShowMenu = !ShowMenu;
			}
			if (ShowMenu)
			{
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
			}
		}

		private void OnPlayerTab()
		{
			MenuUtilities.Toggle(ref Config.Instance.Player.Noclip, "Noclip (V)");
			Config.Instance.Player.NoclipSpeed = MenuUtilities.HorizontalSlider("Noclip Speed", Config.Instance.Player.NoclipSpeed, 0f, 50f);
			Config.Instance.Player.WalkSpeed = MenuUtilities.HorizontalSlider("Walk Speed", Config.Instance.Player.WalkSpeed, 0f, 20f);
			if (MenuUtilities.Button("Set Walk Speed"))
			{
				GameUtilities.LocalPlayerController.WalkSpeed = Config.Instance.Player.WalkSpeed;
			}
			Config.Instance.Player.SprintSpeed = MenuUtilities.HorizontalSlider("Sprint Speed", Config.Instance.Player.SprintSpeed, 0f, 20f);
			if (MenuUtilities.Button("Set Sprint Speed"))
			{
				GameUtilities.LocalPlayerController.SprintSpeed = Config.Instance.Player.SprintSpeed;
			}
			Config.Instance.Player.JumpHeight = MenuUtilities.HorizontalSlider("Jump Height", Config.Instance.Player.JumpHeight, 0f, 20f);
			if (MenuUtilities.Button("Set Jump Height"))
			{
				GameUtilities.LocalPlayerController.JumpHeight = Config.Instance.Player.JumpHeight;
			}
		}

		private void OnResearchTab()
		{
			Config.Instance.Research.AddTickets = MenuUtilities.TextField(Config.Instance.Research.AddTickets);
			if (MenuUtilities.Button("Add Tickets") && int.TryParse(Config.Instance.Economy.AddMoney, out var result))
			{
				GameUtilities.ResearchManager.AddResearchTickets(result);
			}
		}

		private void OnMinersSubTab()
		{
			string[] array = GameUtilities.AutoMiners.Select((AutoMiner obj) => ((object)obj).ToString()).ToArray();
			Config.MinerConfig miners = Config.Instance.Miners;
			string[] array2 = array;
			int num = 0;
			string[] array3 = new string[1 + array2.Length];
			ReadOnlySpan<string> readOnlySpan = new ReadOnlySpan<string>(array2);
			readOnlySpan.CopyTo(new Span<string>(array3).Slice(num, readOnlySpan.Length));
			num += readOnlySpan.Length;
			array3[num] = "All Miners";
			miners.SelectedIndex = MenuUtilities.SelectionTable("Auto Miners", array3, Config.Instance.Miners.SelectedIndex);
			MinerModManager.SelectedMinerIndex = Config.Instance.Miners.SelectedIndex;
			MenuUtilities.Separator(2f, 6f);
			if (Object.op_Implicit((Object)(object)MinerModManager.SelectedMiner))
			{
			}
			MenuUtilities.Toggle(ref Config.Instance.Miners.HighlightSelected, "Highlight Selected");
			Config.Instance.Miners.SpawnRate = MenuUtilities.HorizontalSlider("Spawn Rate", Config.Instance.Miners.SpawnRate, 0f, 10f);
			if (MenuUtilities.Button("Set Spawn Rate"))
			{
				MinerModManager.ApplySpawnRate(Config.Instance.Miners.SpawnRate);
			}
		}

		private void OnFurnacesSubTab()
		{
			string[] array = GameUtilities.Furnaces.Select((BlastFurnace obj) => ((object)obj).ToString()).ToArray();
			Config.FurnacesConfig furnaces = Config.Instance.Furnaces;
			string[] array2 = array;
			int num = 0;
			string[] array3 = new string[1 + array2.Length];
			ReadOnlySpan<string> readOnlySpan = new ReadOnlySpan<string>(array2);
			readOnlySpan.CopyTo(new Span<string>(array3).Slice(num, readOnlySpan.Length));
			num += readOnlySpan.Length;
			array3[num] = "All Furnaces";
			furnaces.SelectedIndex = MenuUtilities.SelectionTable("Furnaces", array3, Config.Instance.Furnaces.SelectedIndex);
			FurnaceModManager.SelectedFurnaceIndex = Config.Instance.Furnaces.SelectedIndex;
			MenuUtilities.Separator(2f, 6f);
			MenuUtilities.Toggle(ref Config.Instance.Furnaces.HighlightSelected, "Highlight Selected");
			Config.Instance.Furnaces.ProcessingTime = MenuUtilities.HorizontalSlider("Processing Time", Config.Instance.Furnaces.ProcessingTime, 0f, 10f);
			if (MenuUtilities.Button("Set Processing Rate"))
			{
				FurnaceModManager.ApplyProcessingTime(Config.Instance.Furnaces.ProcessingTime);
			}
		}

		private void OnEconomyTab()
		{
			Config.Instance.Economy.AddMoney = MenuUtilities.TextField(Config.Instance.Economy.AddMoney);
			if (MenuUtilities.Button("Add Money") && float.TryParse(Config.Instance.Economy.AddMoney, out var result))
			{
				GameUtilities.EconomyManager.AddMoney(result);
			}
			if (MenuUtilities.Button("Unlock All Shop Items"))
			{
				GameUtilities.EconomyManager.UnlockAllShopItems();
			}
		}

		private void OnDepositBoxSubTab()
		{
			if (MenuUtilities.Button("Upgrade To Tier 2"))
			{
				GameUtilities.DepositBox.UpgradeToTier2();
			}
			MenuUtilities.Toggle(ref Config.Instance.DepositBox.InstantSell, "Instant Sell");
		}

		private void OnDetonatorsSubTab()
		{
			if (MenuUtilities.Button("Detonate All"))
			{
				Object.FindObjectsByType<DetonatorTrigger>((FindObjectsSortMode)0).ToList().ForEach(delegate(DetonatorTrigger obj)
				{
					obj.Interact((Interaction)null);
				});
			}
		}

		private void OnPolishingMachineSubTab()
		{
			MenuUtilities.Toggle(ref Config.Instance.PolishingMachine.IgnoreDirtyOres, "Ignore Dirty Ores");
		}

		private void OnWorldTab()
		{
			MenuUtilities.BeginHorizontal();
			if (MenuUtilities.Button("Miners", CurrentSubTab == SubMenuTab.Miners))
			{
				CurrentSubTab = SubMenuTab.Miners;
			}
			if (MenuUtilities.Button("Furnaces", CurrentSubTab == SubMenuTab.Furnaces))
			{
				CurrentSubTab = SubMenuTab.Furnaces;
			}
			if (MenuUtilities.Button("Polishing", CurrentSubTab == SubMenuTab.PolishingMachine))
			{
				CurrentSubTab = SubMenuTab.PolishingMachine;
			}
			if (MenuUtilities.Button("Deposit Box", CurrentSubTab == SubMenuTab.DepositBox))
			{
				CurrentSubTab = SubMenuTab.DepositBox;
			}
			if (MenuUtilities.Button("Detonators", CurrentSubTab == SubMenuTab.Detonators))
			{
				CurrentSubTab = SubMenuTab.Detonators;
			}
			MenuUtilities.EndHorizontal();
			MenuUtilities.Space(10f);
			switch (CurrentSubTab)
			{
			case SubMenuTab.Furnaces:
				OnFurnacesSubTab();
				break;
			case SubMenuTab.Miners:
				OnMinersSubTab();
				break;
			case SubMenuTab.PolishingMachine:
				OnPolishingMachineSubTab();
				break;
			case SubMenuTab.DepositBox:
				OnDepositBoxSubTab();
				break;
			case SubMenuTab.Detonators:
				OnDetonatorsSubTab();
				break;
			}
		}

		private void OnQuestsTab()
		{
			if (MenuUtilities.Button("Complete All"))
			{
				GameUtilities.QuestManager.AllQuests.ToList().ForEach(delegate(Quest quest)
				{
					quest.DebugUnlock();
				});
			}
			if (MenuUtilities.Button("Complete Active"))
			{
				GameUtilities.QuestManager.ActiveQuests.ToList().ForEach(delegate(Quest quest)
				{
					quest.DebugUnlock();
				});
			}
			if (MenuUtilities.Button("Unlock All"))
			{
				GameUtilities.QuestManager.AllQuests.ToList().ForEach(delegate(Quest quest)
				{
					quest.PrerequisiteQuests.Clear();
				});
			}
		}

		private void OnSettingsTab()
		{
			MenuUtilities.Toggle(ref Config.Instance.Settings.HighlightThroughWalls, "Highlight Through Walls");
			MenuUtilities.ColorPicker("Miner Highlight Color", ref Config.Instance.Settings.MinerHighlightColor);
			MenuUtilities.ColorPicker("Furnace Highlight Color", ref Config.Instance.Settings.FurnaceHighlightColor);
		}

		private void OnWindow(int id)
		{
			MenuUtilities.Space(25f);
			MenuUtilities.BeginHorizontal();
			if (MenuUtilities.Button("Player", CurrentTab == MenuTab.Player))
			{
				CurrentTab = MenuTab.Player;
			}
			if (MenuUtilities.Button("Research", CurrentTab == MenuTab.Research))
			{
				CurrentTab = MenuTab.Research;
			}
			if (MenuUtilities.Button("Economy", CurrentTab == MenuTab.Economy))
			{
				CurrentTab = MenuTab.Economy;
			}
			if (MenuUtilities.Button("World", CurrentTab == MenuTab.World))
			{
				CurrentTab = MenuTab.World;
			}
			if (MenuUtilities.Button("Quests", CurrentTab == MenuTab.Quests))
			{
				CurrentTab = MenuTab.Quests;
			}
			if (MenuUtilities.Button("Settings", CurrentTab == MenuTab.Settings))
			{
				CurrentTab = MenuTab.Settings;
			}
			MenuUtilities.EndHorizontal();
			switch (CurrentTab)
			{
			case MenuTab.Player:
				MenuUtilities.Space(10f);
				OnPlayerTab();
				break;
			case MenuTab.Research:
				MenuUtilities.Space(10f);
				OnResearchTab();
				break;
			case MenuTab.Economy:
				MenuUtilities.Space(10f);
				OnEconomyTab();
				break;
			case MenuTab.World:
				OnWorldTab();
				break;
			case MenuTab.Quests:
				MenuUtilities.Space(10f);
				OnQuestsTab();
				break;
			case MenuTab.Settings:
				MenuUtilities.Space(10f);
				OnSettingsTab();
				break;
			}
			MenuUtilities.DragWindow(ref windowRect);
		}

		private void OnGUI()
		{
			//IL_001c: 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_003c: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			MenuUtilities.InitStyles();
			if (ShowMenu)
			{
				GUI.Window(55223, windowRect, new WindowFunction(OnWindow), "MineMogul Mod Menu", MenuUtilities.WindowStyle);
			}
		}
	}
	public class MenuUtilities : MonoBehaviour
	{
		private static Texture2D checkboxOffTexture;

		private static Texture2D checkboxOnTexture;

		private static bool stylesInit;

		public static bool IsDragging { get; private set; }

		public static Vector2 DragOffset { get; private set; }

		public static GUIStyle WindowStyle { get; private set; }

		public static GUIStyle ButtonStyle { get; private set; }

		public static GUIStyle SelectedButtonStyle { get; private set; }

		public static GUIStyle HeaderStyle { get; private set; }

		public static GUIStyle ToggleStyle { get; private set; }

		public static GUIStyle ToggleLabelStyle { get; private set; }

		public static GUIStyle TextFieldStyle { get; private set; }

		public static GUIStyle TextAreaStyle { get; private set; }

		public static GUIStyle SliderStyle { get; private set; }

		public static GUIStyle SliderThumbStyle { get; private set; }

		public static GUIStyle ColorPickerSliderStyle { get; private set; }

		public static GUIStyle SelectionTableStyle { get; private set; }

		public static GUIStyle SelectionTableSelectedStyle { get; private set; }

		public static GUIStyle SelectionTableBorderStyle { get; private set; }

		public static GUIStyle SelectionTableLabelStyle { get; private set; }

		public static GUIStyle SeparatorStyle { get; private set; }

		public static void ResetStyles()
		{
			stylesInit = false;
		}

		public static void DragWindow(ref Rect windowRect)
		{
			//IL_0003: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_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_00bf: 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)
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor(((Rect)(ref windowRect)).x, ((Rect)(ref windowRect)).y, ((Rect)(ref windowRect)).width, 30f);
			if (Input.GetMouseButtonDown(0) && ((Rect)(ref val2)).Contains(val))
			{
				IsDragging = true;
				DragOffset = val - new Vector2(((Rect)(ref windowRect)).x, ((Rect)(ref windowRect)).y);
			}
			if (Input.GetMouseButtonUp(0))
			{
				IsDragging = false;
			}
			if (IsDragging && Input.GetMouseButton(0))
			{
				((Rect)(ref windowRect)).x = val.x - DragOffset.x;
				((Rect)(ref windowRect)).y = val.y - DragOffset.y;
			}
		}

		private static Texture2D MakeTex(int w, int h, Color col)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(w, h);
			((Object)val).hideFlags = (HideFlags)61;
			Color[] array = (Color[])(object)new Color[w * h];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = col;
			}
			val.SetPixels(array);
			val.Apply();
			return val;
		}

		public static bool Button(string label)
		{
			return GUILayout.Button(label, ButtonStyle, Array.Empty<GUILayoutOption>());
		}

		public static bool Button(string label, bool selected)
		{
			GUIStyle val = (selected ? SelectedButtonStyle : ButtonStyle);
			return GUILayout.Button(label, val, Array.Empty<GUILayoutOption>());
		}

		public static bool Button(string label, float width)
		{
			return GUILayout.Button(label, ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) });
		}

		public static bool Button(string label, float width, bool selected)
		{
			GUIStyle val = (selected ? SelectedButtonStyle : ButtonStyle);
			return GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) });
		}

		public static bool Button(string label, float width, float height)
		{
			return GUILayout.Button(label, ButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(width),
				GUILayout.Height(height)
			});
		}

		public static bool Button(string label, float width, float height, bool selected)
		{
			GUIStyle val = (selected ? SelectedButtonStyle : ButtonStyle);
			return GUILayout.Button(label, val, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(width),
				GUILayout.Height(height)
			});
		}

		public static bool Toggle(bool value, string label)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			Rect rect = GUILayoutUtility.GetRect(200f, 20f);
			Texture2D val = (value ? checkboxOnTexture : checkboxOffTexture);
			if (GUI.Button(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 20f, 20f), (Texture)(object)val, GUIStyle.none))
			{
				value = !value;
			}
			GUI.Label(new Rect(((Rect)(ref rect)).x + 26f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 26f, 20f), label, ToggleLabelStyle);
			return value;
		}

		public static void Toggle(ref bool value, string label)
		{
			value = Toggle(value, label);
		}

		public static void Label(string text)
		{
			GUILayout.Label(text, HeaderStyle, Array.Empty<GUILayoutOption>());
		}

		public static void Label(string text, float width)
		{
			GUILayout.Label(text, HeaderStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) });
		}

		public static string TextField(string text)
		{
			return GUILayout.TextField(text, TextFieldStyle, Array.Empty<GUILayoutOption>());
		}

		public static string TextField(string text, float width)
		{
			return GUILayout.TextField(text, TextFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) });
		}

		public static string TextArea(string text, float height)
		{
			return GUILayout.TextArea(text, TextAreaStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(height) });
		}

		public static string TextArea(string text, float width, float height)
		{
			return GUILayout.TextArea(text, TextAreaStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(width),
				GUILayout.Height(height)
			});
		}

		public static float HorizontalSlider(float value, float min, float max)
		{
			return GUILayout.HorizontalSlider(value, min, max, SliderStyle, SliderThumbStyle, Array.Empty<GUILayoutOption>());
		}

		public static float HorizontalSlider(float value, float min, float max, float width)
		{
			return GUILayout.HorizontalSlider(value, min, max, SliderStyle, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(width) });
		}

		public static float HorizontalSlider(string label, float value, float min, float max)
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			value = GUILayout.HorizontalSlider(value, min, max, SliderStyle, SliderThumbStyle, Array.Empty<GUILayoutOption>());
			string text = $"{label}: {value:F2}";
			GUILayout.Label(text, HeaderStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			GUILayout.EndHorizontal();
			return value;
		}

		public static float HorizontalSlider(string label, float value, float min, float max, float sliderWidth)
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			value = GUILayout.HorizontalSlider(value, min, max, SliderStyle, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(sliderWidth) });
			string text = $"{label}: {value:F2}";
			GUILayout.Label(text, HeaderStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			GUILayout.EndHorizontal();
			return value;
		}

		public static float HorizontalSlider(string label, float value, float min, float max, string format)
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			value = GUILayout.HorizontalSlider(value, min, max, SliderStyle, SliderThumbStyle, Array.Empty<GUILayoutOption>());
			string text = label + ": " + value.ToString(format);
			GUILayout.Label(text, HeaderStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) });
			GUILayout.EndHorizontal();
			return value;
		}

		public static float HorizontalSlider(string label, float value, float min, float max, float sliderWidth, string format)
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			value = GUILayout.HorizontalSlider(value, min, max, SliderStyle, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(sliderWidth) });
			string text = label + ": " + value.ToString(format);
			GUILayout.Label(text, HeaderStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) });
			GUILayout.EndHorizontal();
			return value;
		}

		public static int SelectionTable(string label, string[] options, int selectedIndex)
		{
			return SelectionTable(label, options, selectedIndex, 150f, 10f);
		}

		public static int SelectionTable(string label, string[] options, int selectedIndex, float height)
		{
			return SelectionTable(label, options, selectedIndex, height, 10f);
		}

		public static int SelectionTable(string label, string[] options, int selectedIndex, float height, float padding)
		{
			GUILayout.Label(label, SelectionTableLabelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(2f);
			GUILayout.BeginVertical(SelectionTableBorderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(padding);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(padding);
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Height(height),
				GUILayout.ExpandWidth(true)
			});
			for (int i = 0; i < options.Length; i++)
			{
				GUIStyle val = ((i == selectedIndex) ? SelectionTableSelectedStyle : SelectionTableStyle);
				if (GUILayout.Button(options[i], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }))
				{
					selectedIndex = i;
				}
			}
			GUILayout.EndVertical();
			GUILayout.Space(padding);
			GUILayout.EndHorizontal();
			GUILayout.Space(padding);
			GUILayout.EndVertical();
			return selectedIndex;
		}

		public static void BeginBox()
		{
			GUILayout.BeginVertical(WindowStyle, Array.Empty<GUILayoutOption>());
		}

		public static void EndBox()
		{
			GUILayout.EndVertical();
		}

		public static void BeginHorizontal()
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		}

		public static void EndHorizontal()
		{
			GUILayout.EndHorizontal();
		}

		public static void BeginVertical()
		{
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		}

		public static void EndVertical()
		{
			GUILayout.EndVertical();
		}

		public static void Space(float pixels)
		{
			GUILayout.Space(pixels);
		}

		public static void FlexibleSpace()
		{
			GUILayout.FlexibleSpace();
		}

		public static void Separator()
		{
			GUILayout.Box("", SeparatorStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.Height(2f)
			});
		}

		public static void Separator(float height)
		{
			GUILayout.Box("", SeparatorStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.Height(height)
			});
		}

		public static void Separator(float height, float spacing)
		{
			GUILayout.Space(spacing);
			GUILayout.Box("", SeparatorStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.Height(height)
			});
			GUILayout.Space(spacing);
		}

		public static Color ColorPicker(string label, Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return ColorPicker(label, color, showAlpha: true);
		}

		public static Color ColorPicker(string label, Color color, bool showAlpha)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_008c: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: 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_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Label(label, HeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			Texture2D val = MakeTex(120, 120, color);
			GUILayout.Box((Texture)(object)val, GUIStyle.none, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(120f),
				GUILayout.Height(120f)
			});
			Object.Destroy((Object)(object)val);
			GUILayout.Space(10f);
			GUIStyle val2 = new GUIStyle(SliderStyle)
			{
				margin = new RectOffset(4, 4, 0, 0)
			};
			GUIStyle val3 = new GUIStyle(HeaderStyle)
			{
				contentOffset = new Vector2(0f, -10f)
			};
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("R:", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(20f) });
			color.r = GUILayout.HorizontalSlider(color.r, 0f, 1f, val2, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			GUILayout.Label($"{(int)(color.r * 255f)}", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) });
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("G:", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(20f) });
			color.g = GUILayout.HorizontalSlider(color.g, 0f, 1f, val2, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			GUILayout.Label($"{(int)(color.g * 255f)}", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) });
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("B:", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(20f) });
			color.b = GUILayout.HorizontalSlider(color.b, 0f, 1f, val2, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			GUILayout.Label($"{(int)(color.b * 255f)}", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) });
			GUILayout.EndHorizontal();
			if (showAlpha)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("A:", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(20f) });
				color.a = GUILayout.HorizontalSlider(color.a, 0f, 1f, val2, SliderThumbStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
				GUILayout.Label($"{(int)(color.a * 255f)}", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) });
				GUILayout.EndHorizontal();
			}
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			return color;
		}

		public static void ColorPicker(string label, ref Color color)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			color = ColorPicker(label, color, showAlpha: true);
		}

		public static void ColorPicker(string label, ref Color color, bool showAlpha)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			color = ColorPicker(label, color, showAlpha);
		}

		private static Texture2D MakeCheckbox(int w, int h, Color bgColor)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(w, h);
			((Object)val).hideFlags = (HideFlags)61;
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0.4f, 0.2f, 0.6f, 1f);
			for (int i = 0; i < w; i++)
			{
				for (int j = 0; j < h; j++)
				{
					if (i == 0 || i == w - 1 || j == 0 || j == h - 1)
					{
						val.SetPixel(i, j, val2);
					}
					else
					{
						val.SetPixel(i, j, bgColor);
					}
				}
			}
			val.Apply();
			return val;
		}

		public static void InitStyles()
		{
			//IL_0027: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Expected O, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Expected O, but got Unknown
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Expected O, but got Unknown
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Expected O, but got Unknown
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Expected O, but got Unknown
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_050c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Expected O, but got Unknown
			//IL_051c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Expected O, but got Unknown
			//IL_054a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Expected O, but got Unknown
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Unknown result type (might be due to invalid IL or missing references)
			//IL_0664: Unknown result type (might be due to invalid IL or missing references)
			//IL_066e: Expected O, but got Unknown
			//IL_0678: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Expected O, but got Unknown
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Expected O, but got Unknown
			//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0718: Unknown result type (might be due to invalid IL or missing references)
			//IL_0732: Unknown result type (might be due to invalid IL or missing references)
			//IL_0756: Unknown result type (might be due to invalid IL or missing references)
			//IL_077a: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Expected O, but got Unknown
			//IL_07bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Expected O, but got Unknown
			//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e6: Expected O, but got Unknown
			//IL_0807: Unknown result type (might be due to invalid IL or missing references)
			//IL_0837: Unknown result type (might be due to invalid IL or missing references)
			//IL_0867: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Unknown result type (might be due to invalid IL or missing references)
			//IL_089a: Expected O, but got Unknown
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08aa: Expected O, but got Unknown
			//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08be: Expected O, but got Unknown
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d3: Expected O, but got Unknown
			//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_0954: Unknown result type (might be due to invalid IL or missing references)
			//IL_098e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0998: Expected O, but got Unknown
			//IL_09b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa3: Expected O, but got Unknown
			//IL_0ac1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acb: Expected O, but got Unknown
			//IL_0aec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb1: Expected O, but got Unknown
			//IL_0bd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0beb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf5: Expected O, but got Unknown
			//IL_0bff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c09: Expected O, but got Unknown
			//IL_0c0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c19: Expected O, but got Unknown
			//IL_0c27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c31: Expected O, but got Unknown
			//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c75: Expected O, but got Unknown
			//IL_0c7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c89: Expected O, but got Unknown
			if (!stylesInit)
			{
				checkboxOffTexture = MakeCheckbox(20, 20, new Color(0.18f, 0.18f, 0.18f, 1f));
				checkboxOnTexture = MakeCheckbox(20, 20, new Color(0.5f, 0.2f, 0.7f, 1f));
				Font font = Font.CreateDynamicFontFromOSFont("Consolas", 16);
				WindowStyle = new GUIStyle(GUI.skin.window);
				WindowStyle.normal.background = MakeTex(1, 1, new Color(0.1f, 0.1f, 0.1f, 0.95f));
				WindowStyle.onNormal.background = WindowStyle.normal.background;
				WindowStyle.normal.textColor = new Color(0.757f, 0.6f, 1f);
				WindowStyle.font = font;
				WindowStyle.fontSize = 16;
				WindowStyle.fontStyle = (FontStyle)1;
				WindowStyle.padding = new RectOffset(10, 10, 10, 10);
				WindowStyle.contentOffset = Vector2.zero;
				WindowStyle.alignment = (TextAnchor)1;
				ButtonStyle = new GUIStyle(GUI.skin.button);
				ButtonStyle.normal.background = MakeTex(1, 1, new Color(0.18f, 0.18f, 0.18f, 1f));
				ButtonStyle.hover.background = MakeTex(1, 1, new Color(0.25f, 0.15f, 0.35f, 1f));
				ButtonStyle.active.background = MakeTex(1, 1, new Color(0.5f, 0.2f, 0.7f, 1f));
				ButtonStyle.normal.textColor = Color.white;
				ButtonStyle.hover.textColor = new Color(0.9f, 0.6f, 1f);
				ButtonStyle.active.textColor = Color.white;
				ButtonStyle.fontSize = 14;
				ButtonStyle.fontStyle = (FontStyle)0;
				ButtonStyle.padding = new RectOffset(10, 10, 6, 6);
				ButtonStyle.font = font;
				SelectedButtonStyle = new GUIStyle(ButtonStyle);
				SelectedButtonStyle.normal.background = MakeTex(1, 1, new Color(0.5f, 0.2f, 0.7f, 1f));
				SelectedButtonStyle.hover.background = MakeTex(1, 1, new Color(0.6f, 0.3f, 0.8f, 1f));
				SelectedButtonStyle.active.background = MakeTex(1, 1, new Color(0.7f, 0.4f, 0.9f, 1f));
				SelectedButtonStyle.normal.textColor = Color.white;
				SelectedButtonStyle.hover.textColor = Color.white;
				SelectedButtonStyle.active.textColor = Color.white;
				SelectedButtonStyle.fontStyle = (FontStyle)1;
				HeaderStyle = new GUIStyle(GUI.skin.label);
				HeaderStyle.normal.textColor = new Color(1f, 1f, 1f);
				HeaderStyle.fontSize = 14;
				HeaderStyle.alignment = (TextAnchor)3;
				HeaderStyle.font = font;
				ToggleStyle = new GUIStyle(GUI.skin.toggle);
				ToggleStyle.normal.background = checkboxOffTexture;
				ToggleStyle.onNormal.background = checkboxOnTexture;
				ToggleStyle.hover.background = checkboxOffTexture;
				ToggleStyle.onHover.background = checkboxOnTexture;
				ToggleStyle.active.background = checkboxOffTexture;
				ToggleStyle.onActive.background = checkboxOnTexture;
				ToggleStyle.normal.textColor = Color.white;
				ToggleStyle.onNormal.textColor = new Color(0.9f, 0.6f, 1f);
				ToggleStyle.hover.textColor = new Color(0.9f, 0.6f, 1f);
				ToggleStyle.onHover.textColor = new Color(0.9f, 0.6f, 1f);
				ToggleStyle.fontSize = 14;
				ToggleStyle.fixedWidth = 20f;
				ToggleStyle.fixedHeight = 20f;
				ToggleStyle.margin = new RectOffset(4, 4, 4, 4);
				ToggleLabelStyle = new GUIStyle(HeaderStyle);
				ToggleLabelStyle.fontSize = 14;
				ToggleLabelStyle.alignment = (TextAnchor)3;
				TextFieldStyle = new GUIStyle(GUI.skin.textField);
				TextFieldStyle.normal.background = MakeTex(1, 1, new Color(0.15f, 0.15f, 0.15f, 1f));
				TextFieldStyle.hover.background = MakeTex(1, 1, new Color(0.2f, 0.12f, 0.28f, 1f));
				TextFieldStyle.focused.background = MakeTex(1, 1, new Color(0.25f, 0.15f, 0.35f, 1f));
				TextFieldStyle.normal.textColor = Color.white;
				TextFieldStyle.hover.textColor = new Color(0.9f, 0.6f, 1f);
				TextFieldStyle.focused.textColor = new Color(0.9f, 0.6f, 1f);
				TextFieldStyle.fontSize = 14;
				TextFieldStyle.font = font;
				TextFieldStyle.padding = new RectOffset(5, 5, 4, 4);
				TextFieldStyle.border = new RectOffset(2, 2, 2, 2);
				TextAreaStyle = new GUIStyle(GUI.skin.textArea);
				TextAreaStyle.normal.background = MakeTex(1, 1, new Color(0.15f, 0.15f, 0.15f, 1f));
				TextAreaStyle.hover.background = MakeTex(1, 1, new Color(0.2f, 0.12f, 0.28f, 1f));
				TextAreaStyle.focused.background = MakeTex(1, 1, new Color(0.25f, 0.15f, 0.35f, 1f));
				TextAreaStyle.normal.textColor = Color.white;
				TextAreaStyle.hover.textColor = new Color(0.9f, 0.6f, 1f);
				TextAreaStyle.focused.textColor = new Color(0.9f, 0.6f, 1f);
				TextAreaStyle.fontSize = 14;
				TextAreaStyle.font = font;
				TextAreaStyle.padding = new RectOffset(5, 5, 4, 4);
				TextAreaStyle.border = new RectOffset(2, 2, 2, 2);
				TextAreaStyle.wordWrap = true;
				SliderStyle = new GUIStyle(GUI.skin.horizontalSlider);
				SliderStyle.normal.background = MakeTex(1, 1, new Color(0.18f, 0.18f, 0.18f, 1f));
				SliderStyle.hover.background = MakeTex(1, 1, new Color(0.2f, 0.12f, 0.28f, 1f));
				SliderStyle.active.background = MakeTex(1, 1, new Color(0.25f, 0.15f, 0.35f, 1f));
				SliderStyle.fixedHeight = 8f;
				SliderStyle.margin = new RectOffset(4, 4, 8, 8);
				ColorPickerSliderStyle = new GUIStyle(SliderStyle);
				ColorPickerSliderStyle.margin = new RectOffset(4, 4, 0, 0);
				SliderThumbStyle = new GUIStyle(GUI.skin.horizontalSliderThumb);
				SliderThumbStyle.normal.background = MakeTex(1, 1, new Color(0.5f, 0.2f, 0.7f, 1f));
				SliderThumbStyle.hover.background = MakeTex(1, 1, new Color(0.6f, 0.3f, 0.8f, 1f));
				SliderThumbStyle.active.background = MakeTex(1, 1, new Color(0.7f, 0.4f, 0.9f, 1f));
				SliderThumbStyle.fixedWidth = 8f;
				SliderThumbStyle.fixedHeight = 6f;
				SelectionTableStyle = new GUIStyle(GUI.skin.button);
				SelectionTableStyle.normal.background = MakeTex(1, 1, new Color(0.15f, 0.15f, 0.15f, 1f));
				SelectionTableStyle.hover.background = MakeTex(1, 1, new Color(0.2f, 0.12f, 0.28f, 1f));
				SelectionTableStyle.active.background = MakeTex(1, 1, new Color(0.25f, 0.15f, 0.35f, 1f));
				SelectionTableStyle.normal.textColor = Color.white;
				SelectionTableStyle.hover.textColor = new Color(0.9f, 0.6f, 1f);
				SelectionTableStyle.active.textColor = Color.white;
				SelectionTableStyle.fontSize = 14;
				SelectionTableStyle.fontStyle = (FontStyle)0;
				SelectionTableStyle.padding = new RectOffset(8, 8, 6, 6);
				SelectionTableStyle.font = font;
				SelectionTableStyle.alignment = (TextAnchor)3;
				SelectionTableSelectedStyle = new GUIStyle(SelectionTableStyle);
				SelectionTableSelectedStyle.normal.background = MakeTex(1, 1, new Color(0.5f, 0.2f, 0.7f, 1f));
				SelectionTableSelectedStyle.hover.background = MakeTex(1, 1, new Color(0.6f, 0.3f, 0.8f, 1f));
				SelectionTableSelectedStyle.active.background = MakeTex(1, 1, new Color(0.7f, 0.4f, 0.9f, 1f));
				SelectionTableSelectedStyle.normal.textColor = Color.white;
				SelectionTableSelectedStyle.hover.textColor = Color.white;
				SelectionTableSelectedStyle.active.textColor = Color.white;
				SelectionTableSelectedStyle.fontStyle = (FontStyle)1;
				SelectionTableBorderStyle = new GUIStyle();
				SelectionTableBorderStyle.normal.background = MakeTex(1, 1, new Color(0.18f, 0.18f, 0.18f, 1f));
				SelectionTableBorderStyle.border = new RectOffset(2, 2, 2, 2);
				SelectionTableBorderStyle.padding = new RectOffset(0, 0, 0, 0);
				SelectionTableLabelStyle = new GUIStyle(HeaderStyle);
				SelectionTableLabelStyle.fontSize = 14;
				SeparatorStyle = new GUIStyle();
				SeparatorStyle.normal.background = MakeTex(1, 1, new Color(0.18f, 0.18f, 0.18f, 1f));
				SeparatorStyle.margin = new RectOffset(0, 0, 0, 0);
				SeparatorStyle.padding = new RectOffset(0, 0, 0, 0);
				stylesInit = true;
			}
		}
	}
	public class MinerModManager : MonoBehaviour
	{
		public static int SelectedMinerIndex;

		private static AutoMiner _selectedMiner;

		public static AutoMiner SelectedMiner => _selectedMiner;

		public static AutoMiner GetAutoMinerByIndex(int index)
		{
			if (index >= 0 && index < GameUtilities.AutoMiners.Count)
			{
				return GameUtilities.AutoMiners[index];
			}
			return null;
		}

		private void Update()
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			_selectedMiner = GameUtilities.AutoMiners.Where((AutoMiner miner, int index) => index == Config.Instance.Miners.SelectedIndex).FirstOrDefault();
			if (!Config.Instance.Miners.HighlightSelected)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)_selectedMiner))
			{
				DrawingManager.NextDrawEntries.Add(new DrawingEntry
				{
					DrawType = DrawType.BoundingBox,
					Renderers = (Renderer[])(object)new Renderer[1] { ((Component)_selectedMiner).GetComponent<Renderer>() },
					Color = Config.Instance.Settings.MinerHighlightColor
				});
			}
			else
			{
				DrawingManager.NextDrawEntries.Add(new DrawingEntry
				{
					DrawType = DrawType.BoundingBox,
					Renderers = GameUtilities.AutoMiners.Select((AutoMiner f) => ((Component)f).GetComponent<Renderer>()).ToArray(),
					Color = Config.Instance.Settings.MinerHighlightColor
				});
			}
		}

		public static void ApplySpawnRate(float spawnRate)
		{
			if ((Object)(object)_selectedMiner == (Object)null)
			{
				GameUtilities.AutoMiners.ForEach(delegate(AutoMiner miner)
				{
					miner.SpawnRate = spawnRate;
				});
			}
			else if ((Object)(object)_selectedMiner != (Object)null)
			{
				_selectedMiner.SpawnRate = spawnRate;
			}
		}
	}
	public class NoclipController : MonoBehaviour
	{
		private float oldWalkSpeed = 0f;

		private float oldSprintSpeed = 0f;

		private float oldDuckSpeed = 0f;

		private float oldGravity = 0f;

		public bool NoclipActive { get; private set; }

		public float Speed => Config.Instance.Player.NoclipSpeed;

		private void ResetOldValues()
		{
			if (oldDuckSpeed != 0f && oldSprintSpeed != 0f && oldWalkSpeed != 0f)
			{
				GameUtilities.LocalPlayerController.WalkSpeed = oldWalkSpeed;
				oldWalkSpeed = 0f;
				GameUtilities.LocalPlayerController.DuckSpeed = oldDuckSpeed;
				oldDuckSpeed = 0f;
				GameUtilities.LocalPlayerController.SprintSpeed = oldSprintSpeed;
				oldSprintSpeed = 0f;
				GameUtilities.LocalPlayerController.Gravity = oldGravity;
				oldGravity = 0f;
			}
		}

		private void CaptureOldValues()
		{
			if (oldDuckSpeed == 0f && oldSprintSpeed == 0f && oldWalkSpeed == 0f && oldGravity == 0f)
			{
				oldWalkSpeed = GameUtilities.LocalPlayerController.WalkSpeed;
				oldSprintSpeed = GameUtilities.LocalPlayerController.SprintSpeed;
				oldDuckSpeed = GameUtilities.LocalPlayerController.DuckSpeed;
				oldGravity = GameUtilities.LocalPlayerController.Gravity;
			}
		}

		private void FreezePlayerMovement()
		{
			GameUtilities.LocalPlayerController.DuckSpeed = 0f;
			GameUtilities.LocalPlayerController.SprintSpeed = 0f;
			GameUtilities.LocalPlayerController.WalkSpeed = 0f;
			GameUtilities.LocalPlayerController.Gravity = 0f;
		}

		private void DoNoclip()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: 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_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)GameUtilities.LocalPlayerController).transform;
			Transform transform2 = ((Component)GameUtilities.LocalPlayerController.PlayerCamera).transform;
			if (Object.op_Implicit((Object)(object)transform2) && Object.op_Implicit((Object)(object)transform))
			{
				typeof(PlayerController).GetField("_velocity", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(GameUtilities.LocalPlayerController, Vector3.zero);
				Vector3 val = Vector3.zero;
				if (Input.GetKey((KeyCode)119))
				{
					val += transform2.forward;
				}
				if (Input.GetKey((KeyCode)97))
				{
					val -= transform2.right;
				}
				if (Input.GetKey((KeyCode)115))
				{
					val -= transform2.forward;
				}
				if (Input.GetKey((KeyCode)100))
				{
					val += transform2.right;
				}
				if (Input.GetKey((KeyCode)32))
				{
					val += transform.up;
				}
				if (Input.GetKey((KeyCode)99))
				{
					val -= transform.up;
				}
				if (Input.GetKey((KeyCode)304))
				{
					val *= 2f;
				}
				if (Input.GetKey((KeyCode)306))
				{
					val /= 2f;
				}
				transform.position += val * Speed * Time.deltaTime;
			}
		}

		private void ActivateNoclip()
		{
			NoclipActive = true;
			CaptureOldValues();
			FreezePlayerMovement();
		}

		private void DisableNoclip()
		{
			NoclipActive = false;
			ResetOldValues();
		}

		private void LateUpdate()
		{
			if (Input.GetKeyDown((KeyCode)118) && Config.Instance.Player.Noclip)
			{
				NoclipActive = !NoclipActive;
				if (!NoclipActive)
				{
					DisableNoclip();
				}
				else
				{
					ActivateNoclip();
				}
			}
			if (!Config.Instance.Player.Noclip)
			{
				DisableNoclip();
			}
			if (NoclipActive)
			{
				DoNoclip();
			}
		}
	}
	[BepInPlugin("com.pszachary.minemogumodmenu", "MineMogulModMenu", "1.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static Menu MenuComponent;

		internal static GameUtilities GameUtilitiesComponent;

		internal static DrawingManager BoundingBoxManagerComponent;

		internal static MinerModManager MinerModManagerComponent;

		internal static FurnaceModManager FurnaceModManagerComponent;

		internal static NoclipController NoclipControllerComponent;

		internal static Harmony Harmony;

		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			try
			{
				Harmony = new Harmony("com.pszachary.minemogumodmenu");
				Harmony.PatchAll();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Patching complete");
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)$"Harmony patch failed: {arg}");
			}
			MenuComponent = ((Component)this).gameObject.AddComponent<Menu>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added Menu component");
			GameUtilitiesComponent = ((Component)this).gameObject.AddComponent<GameUtilities>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added GameUtilities component");
			BoundingBoxManagerComponent = ((Component)this).gameObject.AddComponent<DrawingManager>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added BoundingBoxManager component");
			MinerModManagerComponent = ((Component)this).gameObject.AddComponent<MinerModManager>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added MinerModManager component");
			FurnaceModManagerComponent = ((Component)this).gameObject.AddComponent<FurnaceModManager>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added FurnaceModManager component");
			NoclipControllerComponent = ((Component)this).gameObject.AddComponent<NoclipController>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Added NoclipController component");
		}

		private void Update()
		{
			AutoMiner[] array = Resources.FindObjectsOfTypeAll<AutoMiner>();
			AutoMiner[] array2 = array;
			foreach (AutoMiner val in array2)
			{
				Log.LogInfo((object)((Object)val).name);
			}
		}
	}
}