Decompiled source of Minimap v1.1.3

Minimap.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using MenuLib;
using MenuLib.MonoBehaviors;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;

[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("Minimap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.1.3.0")]
[assembly: AssemblyInformationalVersion("1.1.3")]
[assembly: AssemblyProduct("Minimap")]
[assembly: AssemblyTitle("Minimap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.3.0")]
[module: UnverifiableCode]
[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 Minimap
{
	internal class Bindings
	{
		internal static void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			if (StateUtils.IsInLevel() && !StateUtils.IsChatActive())
			{
				if (Input.GetKeyDown(ConfigValues.ZoomInKey.Value))
				{
					ConfigValues.Zoom.Value = Mathf.Max(ConfigValues.Zoom.Value - 0.5f, 1.5f);
				}
				if (Input.GetKeyDown(ConfigValues.ZoomOutKey.Value))
				{
					ConfigValues.Zoom.Value = Mathf.Min(ConfigValues.Zoom.Value + 0.5f, 10f);
				}
			}
		}
	}
	public static class ConfigValues
	{
		internal enum PositionPreset
		{
			TopRight,
			TopLeft,
			MiddleRight,
			MiddleLeft,
			Manual
		}

		internal static ConfigEntry<bool> EnabledHintText;

		internal static ConfigEntry<float> Zoom;

		internal static ConfigEntry<float> Opacity;

		internal static ConfigEntry<PositionPreset> Preset;

		internal static ConfigEntry<Vector2> ManualPosition;

		internal static ConfigEntry<float> Width;

		internal static ConfigEntry<float> Height;

		internal static ConfigEntry<float> Buffer;

		internal static ConfigEntry<KeyCode> SettingsKey;

		internal static ConfigEntry<KeyCode> ZoomInKey;

		internal static ConfigEntry<KeyCode> ZoomOutKey;

		internal static void Configure(BaseUnityPlugin plugin)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Expected O, but got Unknown
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Expected O, but got Unknown
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Expected O, but got Unknown
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Expected O, but got Unknown
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Expected O, but got Unknown
			EnabledHintText = plugin.Config.Bind<bool>("General", "Enable Hint Text", true, new ConfigDescription("Should the hint text for opening the settings show under the minimap? (Recommended value = true)", (AcceptableValueBase)null, Array.Empty<object>()));
			Zoom = plugin.Config.Bind<float>("General", "Zoom", 2.25f, new ConfigDescription("The minimap zoom level. (Recommended value = 2.25)", (AcceptableValueBase)null, Array.Empty<object>()));
			Opacity = plugin.Config.Bind<float>("General", "Opacity", 0.85f, new ConfigDescription("The minimap opacity. (Recommended value = 0.85)", (AcceptableValueBase)null, Array.Empty<object>()));
			Preset = plugin.Config.Bind<PositionPreset>("Position", "Preset", PositionPreset.TopRight, new ConfigDescription("The minimap position preset. (Recommended value = TopRight)", (AcceptableValueBase)null, Array.Empty<object>()));
			ManualPosition = plugin.Config.Bind<Vector2>("Position", "Manual Position", new Vector2(0f, 0f), new ConfigDescription("The position of the minimap as X, Y coordinates, preset must be set to Manual. (Recommended to use the in-game editor to edit this)", (AcceptableValueBase)null, Array.Empty<object>()));
			Width = plugin.Config.Bind<float>("Dimensions", "Width", 375f, new ConfigDescription("The width of the minimap. (Recommended value = 375)", (AcceptableValueBase)null, Array.Empty<object>()));
			Height = plugin.Config.Bind<float>("Dimensions", "Height", 375f, new ConfigDescription("The height of the minimap. (Recommended value = 375)", (AcceptableValueBase)null, Array.Empty<object>()));
			Buffer = plugin.Config.Bind<float>("Dimensions", "Buffer", 12f, new ConfigDescription("The buffer between edge of screen added to presets. (Recommended value = 12)", (AcceptableValueBase)null, Array.Empty<object>()));
			SettingsKey = plugin.Config.Bind<KeyCode>("Key Bindings", "Settings", (KeyCode)109, new ConfigDescription("The key to open the minimap settings. (Recommended value = M)", (AcceptableValueBase)null, Array.Empty<object>()));
			ZoomInKey = plugin.Config.Bind<KeyCode>("Key Bindings", "Zoom In", (KeyCode)61, new ConfigDescription("The key to zoom in on the minimap. (Recommended value = Equals)", (AcceptableValueBase)null, Array.Empty<object>()));
			ZoomOutKey = plugin.Config.Bind<KeyCode>("Key Bindings", "Zoom Out", (KeyCode)45, new ConfigDescription("The key to zoom out on the minimap. (Recommended value = Minus)", (AcceptableValueBase)null, Array.Empty<object>()));
		}

		internal static void ResetDefaultValues()
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			EnabledHintText.Value = (bool)((ConfigEntryBase)EnabledHintText).DefaultValue;
			Zoom.Value = (float)((ConfigEntryBase)Zoom).DefaultValue;
			Opacity.Value = (float)((ConfigEntryBase)Opacity).DefaultValue;
			Preset.Value = (PositionPreset)((ConfigEntryBase)Preset).DefaultValue;
			ManualPosition.Value = (Vector2)((ConfigEntryBase)ManualPosition).DefaultValue;
			Width.Value = (float)((ConfigEntryBase)Width).DefaultValue;
			Height.Value = (float)((ConfigEntryBase)Height).DefaultValue;
			SettingsKey.Value = (KeyCode)((ConfigEntryBase)SettingsKey).DefaultValue;
			ZoomInKey.Value = (KeyCode)((ConfigEntryBase)ZoomInKey).DefaultValue;
			ZoomOutKey.Value = (KeyCode)((ConfigEntryBase)ZoomOutKey).DefaultValue;
		}
	}
	[HarmonyPatch(typeof(PlayerNameChecker))]
	internal static class PlayerNamesUpdatePatch
	{
		[CompilerGenerated]
		private sealed class <Transpiler>d__1 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private CodeInstruction <>2__current;

			private int <>l__initialThreadId;

			private IEnumerable<CodeInstruction> instructions;

			public IEnumerable<CodeInstruction> <>3__instructions;

			private List<CodeInstruction> <codes>5__1;

			private int <i>5__2;

			CodeInstruction IEnumerator<CodeInstruction>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<codes>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					goto IL_00f4;
				}
				<>1__state = -1;
				<codes>5__1 = instructions.ToList();
				if (mapInstanceField == null)
				{
					mapInstanceField = typeof(Map).GetField("Instance", BindingFlags.Static | BindingFlags.Public);
				}
				<i>5__2 = 0;
				goto IL_0104;
				IL_0104:
				if (<i>5__2 < <codes>5__1.Count)
				{
					if (<codes>5__1[<i>5__2].opcode == OpCodes.Ldsfld && <codes>5__1[<i>5__2].operand as FieldInfo == mapInstanceField)
					{
						<i>5__2 += 2;
						goto IL_00f4;
					}
					<>2__current = <codes>5__1[<i>5__2];
					<>1__state = 1;
					return true;
				}
				return false;
				IL_00f4:
				<i>5__2++;
				goto IL_0104;
			}

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

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

			[DebuggerHidden]
			IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
			{
				<Transpiler>d__1 <Transpiler>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<Transpiler>d__ = this;
				}
				else
				{
					<Transpiler>d__ = new <Transpiler>d__1(0);
				}
				<Transpiler>d__.instructions = <>3__instructions;
				return <Transpiler>d__;
			}

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

		private static FieldInfo mapInstanceField;

		[IteratorStateMachine(typeof(<Transpiler>d__1))]
		[HarmonyPatch("Update")]
		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Transpiler>d__1(-2)
			{
				<>3__instructions = instructions
			};
		}
	}
	[BepInPlugin("Minimap", "Minimap", "1.1.3")]
	public class Plugin : BaseUnityPlugin
	{
		internal const float GOAL_AND_HAUL_Y_OFFSET = -95f;

		private readonly Harmony _harmony = new Harmony("Minimap");

		internal static ManualLogSource Logger;

		private Camera camera;

		private RenderTexture renderTexture;

		private float defaultCameraZoom = -1f;

		private Vector2 initialHaulShowPosition = Vector2.zero;

		private Vector2 targetHaulShowPosition = Vector2.zero;

		private Vector2 initialGoalShowPosition = Vector2.zero;

		private Vector2 targetGoalShowPosition = Vector2.zero;

		private float targetSetHeight = -1f;

		internal static Plugin Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
			((Component)this).gameObject.transform.parent = null;
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			Logger = ((BaseUnityPlugin)this).Logger;
			_harmony.PatchAll(typeof(PlayerNamesUpdatePatch));
			ConfigValues.Configure((BaseUnityPlugin)(object)this);
			Logger.LogInfo((object)"Plugin Minimap is loaded!");
		}

		private void Start()
		{
			SettingsMenu.Initialize();
		}

		private void Update()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_00f0: 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_012c: 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_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_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: 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_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Invalid comparison between Unknown and I4
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			//IL_0484: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: 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_0510: Unknown result type (might be due to invalid IL or missing references)
			//IL_051a: Unknown result type (might be due to invalid IL or missing references)
			Bindings.Update();
			SettingsMenu.Update();
			if (!StateUtils.IsInLevel())
			{
				if ((Object)(object)camera != (Object)null || (Object)(object)renderTexture != (Object)null)
				{
					camera = null;
					renderTexture = null;
				}
				return;
			}
			if ((Object)(object)camera == (Object)null)
			{
				Camera[] array = Object.FindObjectsOfType<Camera>(true);
				Camera[] array2 = array;
				foreach (Camera val in array2)
				{
					if (((Object)val).name == "Dirt Finder Map Camera")
					{
						camera = val;
						break;
					}
				}
			}
			if (targetHaulShowPosition == Vector2.zero || targetGoalShowPosition == Vector2.zero)
			{
				initialHaulShowPosition = ((SemiUI)HaulUI.instance).showPosition;
				initialGoalShowPosition = ((SemiUI)GoalUI.instance).showPosition;
				float num = ConfigValues.Height.Value / 300f;
				targetHaulShowPosition = new Vector2(initialHaulShowPosition.x, initialHaulShowPosition.y + -95f * num);
				targetGoalShowPosition = new Vector2(initialGoalShowPosition.x, initialGoalShowPosition.y + -95f * num);
			}
			if (targetSetHeight != ConfigValues.Height.Value)
			{
				float num2 = ConfigValues.Height.Value / 300f;
				targetHaulShowPosition.y = initialHaulShowPosition.y + -95f * num2;
				targetGoalShowPosition.y = initialGoalShowPosition.y + -95f * num2;
				targetSetHeight = ConfigValues.Height.Value;
			}
			if (ConfigValues.Preset.Value == ConfigValues.PositionPreset.TopRight && (((SemiUI)HaulUI.instance).showPosition != targetHaulShowPosition || ((SemiUI)GoalUI.instance).showPosition != targetGoalShowPosition))
			{
				((SemiUI)HaulUI.instance).showPosition = targetHaulShowPosition;
				((SemiUI)GoalUI.instance).showPosition = targetGoalShowPosition;
			}
			else if (ConfigValues.Preset.Value != 0 && (((SemiUI)HaulUI.instance).showPosition != initialHaulShowPosition || ((SemiUI)GoalUI.instance).showPosition != initialGoalShowPosition))
			{
				((SemiUI)HaulUI.instance).showPosition = initialHaulShowPosition;
				((SemiUI)GoalUI.instance).showPosition = initialGoalShowPosition;
			}
			if ((Object)(object)Map.Instance != (Object)null && !Map.Instance.Active)
			{
				Map.Instance.ActiveSet(true);
			}
			if ((Object)(object)camera != (Object)null && ((Object)(object)renderTexture == (Object)null || ((Object)(object)camera.activeTexture != (Object)null && (Object)(object)camera.activeTexture != (Object)(object)renderTexture)))
			{
				renderTexture = camera.activeTexture;
			}
			if ((Object)(object)camera != (Object)null)
			{
				if (defaultCameraZoom == -1f)
				{
					defaultCameraZoom = camera.orthographicSize;
				}
				float num3 = ((!StateUtils.HasLocalMapToolActive()) ? ConfigValues.Zoom.Value : defaultCameraZoom);
				if (camera.orthographicSize != num3)
				{
					camera.orthographicSize = num3;
				}
			}
			if ((Object)(object)PlayerAvatar.instance != (Object)null && PlayerAvatar.instance.spectating && (Object)(object)SpectateCamera.instance != (Object)null && (int)SpectateCamera.instance.currentState == 1)
			{
				Transform transform = ((Component)SpectateCamera.instance).transform;
				PlayerAvatar player = SpectateCamera.instance.player;
				Quaternion rotation;
				if ((Object)(object)player != (Object)null)
				{
					DirtFinderMapPlayer.Instance.PlayerTransform.position = ((Component)player).transform.position;
					Transform playerTransform = DirtFinderMapPlayer.Instance.PlayerTransform;
					rotation = ((Component)player).transform.rotation;
					float y = ((Quaternion)(ref rotation)).eulerAngles.y;
					rotation = ((Component)player).transform.rotation;
					playerTransform.rotation = Quaternion.Euler(0f, y, ((Quaternion)(ref rotation)).eulerAngles.z);
					PlayerController.instance.playerAvatarScript.LastNavmeshPosition = player.LastNavmeshPosition;
				}
				else if ((Object)(object)transform != (Object)null)
				{
					DirtFinderMapPlayer.Instance.PlayerTransform.position = transform.position;
					Transform playerTransform2 = DirtFinderMapPlayer.Instance.PlayerTransform;
					rotation = transform.rotation;
					float y2 = ((Quaternion)(ref rotation)).eulerAngles.y;
					rotation = transform.rotation;
					playerTransform2.rotation = Quaternion.Euler(0f, y2, ((Quaternion)(ref rotation)).eulerAngles.z);
				}
			}
		}

		private void OnGUI()
		{
			//IL_0033: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: 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_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: 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)
			if (!StateUtils.IsInLevel() || !Object.op_Implicit((Object)(object)renderTexture) || StateUtils.HasLocalMapToolActive())
			{
				return;
			}
			float num;
			float num2;
			if (SettingsMenu.isSelectingPosition)
			{
				num = Input.mousePosition.x;
				num2 = (float)Screen.height * (1f - Input.mousePosition.y / (float)Screen.height);
			}
			else
			{
				switch (ConfigValues.Preset.Value)
				{
				case ConfigValues.PositionPreset.TopLeft:
					num = ConfigValues.Buffer.Value;
					num2 = ConfigValues.Buffer.Value * 2f;
					break;
				case ConfigValues.PositionPreset.MiddleLeft:
					num = ConfigValues.Buffer.Value;
					num2 = ((float)Screen.height - ConfigValues.Height.Value) / 2f;
					break;
				case ConfigValues.PositionPreset.MiddleRight:
					num = (float)Screen.width - ConfigValues.Width.Value - ConfigValues.Buffer.Value;
					num2 = ((float)Screen.height - ConfigValues.Height.Value) / 2f;
					break;
				case ConfigValues.PositionPreset.Manual:
					num = ConfigValues.ManualPosition.Value.x;
					num2 = ConfigValues.ManualPosition.Value.y;
					break;
				default:
					num = (float)Screen.width - ConfigValues.Width.Value - ConfigValues.Buffer.Value;
					num2 = ConfigValues.Buffer.Value * 2f;
					break;
				}
			}
			Color color = GUI.color;
			if (ConfigValues.Opacity.Value != 1f)
			{
				GUI.color = new Color(1f, 1f, 1f, ConfigValues.Opacity.Value);
			}
			GUI.DrawTexture(new Rect(num, num2, ConfigValues.Width.Value, ConfigValues.Height.Value), (Texture)(object)renderTexture, (ScaleMode)0, false);
			if (ConfigValues.EnabledHintText.Value)
			{
				Rect val = new Rect(num, num2 + ConfigValues.Width.Value + ConfigValues.Buffer.Value / 2f, ConfigValues.Width.Value, 24f);
				KeyCode value = ConfigValues.SettingsKey.Value;
				GUI.Label(val, "Press [" + ((object)(KeyCode)(ref value)).ToString() + "] for Minimap Settings.");
			}
			if (ConfigValues.Opacity.Value != 1f)
			{
				GUI.color = color;
			}
		}
	}
	internal class SettingsMenu
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static BuilderDelegate <>9__9_0;

			public static BuilderDelegate <>9__12_0;

			public static Action <>9__12_9;

			public static ScrollViewBuilderDelegate <>9__12_1;

			public static Action<string> <>9__12_10;

			public static ScrollViewBuilderDelegate <>9__12_3;

			public static Action<float> <>9__12_11;

			public static ScrollViewBuilderDelegate <>9__12_4;

			public static Action<float> <>9__12_12;

			public static ScrollViewBuilderDelegate <>9__12_5;

			public static Action<float> <>9__12_13;

			public static ScrollViewBuilderDelegate <>9__12_6;

			public static Action<bool> <>9__12_14;

			public static ScrollViewBuilderDelegate <>9__12_7;

			public static ScrollViewBuilderDelegate <>9__12_8;

			public static Action <>9__12_16;

			public static Action <>9__13_0;

			public static Action <>9__13_2;

			public static BuilderDelegate <>9__13_1;

			internal void <Initialize>b__9_0(Transform parent)
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				MenuAPI.CreateREPOButton("Minimap", (Action)View, parent, new Vector2(225f, 252f));
			}

			internal void <View>b__12_0(Transform parent)
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				MenuAPI.CreateREPOButton("Back", (Action)Close, parent, new Vector2(66f, 18f));
			}

			internal RectTransform <View>b__12_1(Transform parent)
			{
				//IL_0030: 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_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: 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)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				REPOButton val = MenuAPI.CreateREPOButton("Reset to Default Settings", (Action)delegate
				{
					ConfigValues.ResetDefaultValues();
					View();
				}, parent, new Vector2(38f, 190f));
				val.overrideButtonSize = new Vector2(val.GetLabelSize().x * 0.8f, val.GetLabelSize().y * 0.8f);
				((Transform)((REPOElement)val).rectTransform).localScale = new Vector3(((Transform)((REPOElement)val).rectTransform).localScale.x * 0.8f, ((Transform)((REPOElement)val).rectTransform).localScale.y * 0.8f, ((Transform)((REPOElement)val).rectTransform).localScale.z);
				return ((REPOElement)val).rectTransform;
			}

			internal void <View>b__12_9()
			{
				ConfigValues.ResetDefaultValues();
				View();
			}

			internal void <View>b__12_10(string s)
			{
				ConfigValues.Preset.Value = OPTION_TO_PRESET[s];
			}

			internal RectTransform <View>b__12_3(Transform parent)
			{
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				REPOButton val = MenuAPI.CreateREPOButton("Manual Set Position", (Action)ViewManualSetPosition, parent, new Vector2(33f, 190f));
				return ((REPOElement)val).rectTransform;
			}

			internal RectTransform <View>b__12_4(Transform parent)
			{
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				REPOSlider val = MenuAPI.CreateREPOSlider("Size", "Minimap Size Height / Width", (Action<float>)delegate(float f)
				{
					ConfigValues.Width.Value = f;
					ConfigValues.Height.Value = f;
				}, parent, new Vector2(0f, 150f), 100f, 800f, 0, Mathf.Max(ConfigValues.Width.Value, ConfigValues.Height.Value), "", "", (BarBehavior)0);
				return ((REPOElement)val).rectTransform;
			}

			internal void <View>b__12_11(float f)
			{
				ConfigValues.Width.Value = f;
				ConfigValues.Height.Value = f;
			}

			internal RectTransform <View>b__12_5(Transform parent)
			{
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				REPOSlider val = MenuAPI.CreateREPOSlider("Zoom Level", "Minimap Zoom Level", (Action<float>)delegate(float f)
				{
					ConfigValues.Zoom.Value = f;
				}, parent, new Vector2(0f, 150f), 1.5f, 10f, 2, ConfigValues.Zoom.Value, "", "", (BarBehavior)0);
				return ((REPOElement)val).rectTransform;
			}

			internal void <View>b__12_12(float f)
			{
				ConfigValues.Zoom.Value = f;
			}

			internal RectTransform <View>b__12_6(Transform parent)
			{
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				REPOSlider val = MenuAPI.CreateREPOSlider("Opacity", "Minimap Opacity", (Action<float>)delegate(float f)
				{
					ConfigValues.Opacity.Value = f;
				}, parent, new Vector2(0f, 150f), 0f, 1f, 2, ConfigValues.Opacity.Value, "", "", (BarBehavior)0);
				return ((REPOElement)val).rectTransform;
			}

			internal void <View>b__12_13(float f)
			{
				ConfigValues.Opacity.Value = f;
			}

			internal RectTransform <View>b__12_7(Transform parent)
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				REPOToggle val = MenuAPI.CreateREPOToggle("Show Hint Text", (Action<bool>)delegate(bool b)
				{
					ConfigValues.EnabledHintText.Value = b;
				}, parent, new Vector2(0f, 90f), "Enabled", "Disabled", ConfigValues.EnabledHintText.Value);
				return ((REPOElement)val).rectTransform;
			}

			internal void <View>b__12_14(bool b)
			{
				ConfigValues.EnabledHintText.Value = b;
			}

			internal RectTransform <View>b__12_8(Transform parent)
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				REPOLabel val = MenuAPI.CreateREPOLabel("Controls", parent, new Vector2(0f, 90f));
				return ((REPOElement)val).rectTransform;
			}

			internal void <View>b__12_16()
			{
			}

			internal void <ViewManualSetPosition>b__13_0()
			{
			}

			internal void <ViewManualSetPosition>b__13_1(Transform parent)
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				MenuAPI.CreateREPOButton("Apply", (Action)delegate
				{
					isSelectingPosition = false;
					isInManualMode = false;
					View();
				}, parent, new Vector2(66f, 18f));
			}

			internal void <ViewManualSetPosition>b__13_2()
			{
				isSelectingPosition = false;
				isInManualMode = false;
				View();
			}
		}

		private static Dictionary<string, ConfigValues.PositionPreset> OPTION_TO_PRESET = new Dictionary<string, ConfigValues.PositionPreset>
		{
			{
				"Top-right",
				ConfigValues.PositionPreset.TopRight
			},
			{
				"Top-left",
				ConfigValues.PositionPreset.TopLeft
			},
			{
				"Middle-right",
				ConfigValues.PositionPreset.MiddleRight
			},
			{
				"Middle-left",
				ConfigValues.PositionPreset.MiddleLeft
			},
			{
				"Manual",
				ConfigValues.PositionPreset.Manual
			}
		};

		private static List<ConfigEntry<KeyCode>> BINDABLE_KEYS = new List<ConfigEntry<KeyCode>>
		{
			ConfigValues.SettingsKey,
			ConfigValues.ZoomInKey,
			ConfigValues.ZoomOutKey
		};

		private static List<KeyCode> DISALLOWED_BINDINGS = new List<KeyCode>
		{
			(KeyCode)323,
			(KeyCode)324,
			(KeyCode)27
		};

		private static REPOPopupPage pageInstance;

		internal static bool isInManualMode = false;

		internal static bool isSelectingPosition = false;

		private static bool isSelectingKey = false;

		private static ConfigEntry<KeyCode> keyToSet;

		private static REPOButton activatedButton;

		internal static void Initialize()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__9_0;
			if (obj == null)
			{
				BuilderDelegate val = delegate(Transform parent)
				{
					//IL_002b: Unknown result type (might be due to invalid IL or missing references)
					MenuAPI.CreateREPOButton("Minimap", (Action)View, parent, new Vector2(225f, 252f));
				};
				<>c.<>9__9_0 = val;
				obj = (object)val;
			}
			MenuAPI.AddElementToSettingsMenu((BuilderDelegate)obj);
		}

		internal static void Update()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: 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)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: 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)
			if (StateUtils.IsInLevel() && !StateUtils.IsChatActive() && !StateUtils.HasLocalMapToolActive() && Input.GetKeyDown(ConfigValues.SettingsKey.Value))
			{
				if ((Object)(object)pageInstance == (Object)null)
				{
					View();
				}
				else
				{
					Close();
				}
			}
			if (StateUtils.IsInLevel() && StateUtils.HasLocalMapToolActive() && (Object)(object)pageInstance != (Object)null)
			{
				Close();
			}
			if (isInManualMode && Input.GetKeyDown((KeyCode)323))
			{
				isSelectingPosition = !isSelectingPosition;
				if (!isSelectingPosition)
				{
					float num = 1f - Input.mousePosition.y / (float)Screen.height;
					Vector2 value = default(Vector2);
					((Vector2)(ref value))..ctor(Input.mousePosition.x, (float)Screen.height * num);
					ConfigValues.ManualPosition.Value = value;
					ConfigValues.Preset.Value = ConfigValues.PositionPreset.Manual;
				}
			}
			if (!isSelectingKey || !Input.anyKeyDown)
			{
				return;
			}
			foreach (KeyCode value3 in Enum.GetValues(typeof(KeyCode)))
			{
				if (Input.GetKeyDown(value3))
				{
					if (!DISALLOWED_BINDINGS.Contains(value3))
					{
						keyToSet.Value = value3;
					}
					TextMeshProUGUI labelTMP = activatedButton.labelTMP;
					string key = ((ConfigEntryBase)keyToSet).Definition.Key;
					KeyCode value2 = keyToSet.Value;
					((TMP_Text)labelTMP).text = key + ": " + ((object)(KeyCode)(ref value2)).ToString();
					isSelectingKey = false;
					keyToSet = null;
					activatedButton = null;
					break;
				}
			}
		}

		private static void Close()
		{
			if (!((Object)(object)pageInstance == (Object)null))
			{
				MenuManager.instance.PageRemove(pageInstance.menuPage);
				Object.Destroy((Object)(object)((Component)pageInstance.menuPage).gameObject);
				pageInstance.ClosePage(true);
				pageInstance = null;
				isSelectingPosition = false;
				isInManualMode = false;
				isSelectingKey = false;
				keyToSet = null;
				activatedButton = null;
			}
		}

		private static void View()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_005b: 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_0066: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Expected O, but got Unknown
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Expected O, but got Unknown
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Expected O, but got Unknown
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Expected O, but got Unknown
			//IL_01fe: 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_0209: Expected O, but got Unknown
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			Close();
			REPOPopupPage val = MenuAPI.CreateREPOPopupPage("Minimap", (PresetSide)0, false, true, 0f);
			object obj = <>c.<>9__12_0;
			if (obj == null)
			{
				BuilderDelegate val2 = delegate(Transform parent)
				{
					//IL_002b: Unknown result type (might be due to invalid IL or missing references)
					MenuAPI.CreateREPOButton("Back", (Action)Close, parent, new Vector2(66f, 18f));
				};
				<>c.<>9__12_0 = val2;
				obj = (object)val2;
			}
			val.AddElement((BuilderDelegate)obj);
			object obj2 = <>c.<>9__12_1;
			if (obj2 == null)
			{
				ScrollViewBuilderDelegate val3 = delegate(Transform parent)
				{
					//IL_0030: 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_004e: Unknown result type (might be due to invalid IL or missing references)
					//IL_005e: 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)
					//IL_008f: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00af: Unknown result type (might be due to invalid IL or missing references)
					REPOButton val17 = MenuAPI.CreateREPOButton("Reset to Default Settings", (Action)delegate
					{
						ConfigValues.ResetDefaultValues();
						View();
					}, parent, new Vector2(38f, 190f));
					val17.overrideButtonSize = new Vector2(val17.GetLabelSize().x * 0.8f, val17.GetLabelSize().y * 0.8f);
					((Transform)((REPOElement)val17).rectTransform).localScale = new Vector3(((Transform)((REPOElement)val17).rectTransform).localScale.x * 0.8f, ((Transform)((REPOElement)val17).rectTransform).localScale.y * 0.8f, ((Transform)((REPOElement)val17).rectTransform).localScale.z);
					return ((REPOElement)val17).rectTransform;
				};
				<>c.<>9__12_1 = val3;
				obj2 = (object)val3;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f);
			string defaultOption = "Top-right";
			foreach (KeyValuePair<string, ConfigValues.PositionPreset> item2 in OPTION_TO_PRESET)
			{
				if (item2.Value == ConfigValues.Preset.Value)
				{
					defaultOption = item2.Key;
					break;
				}
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent)
			{
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				REPOSlider val16 = MenuAPI.CreateREPOSlider("Position Preset", "Built-in preset positions", (Action<string>)delegate(string s)
				{
					ConfigValues.Preset.Value = OPTION_TO_PRESET[s];
				}, parent, OPTION_TO_PRESET.Keys.ToArray(), defaultOption, new Vector2(0f, 270f), "", "", (BarBehavior)0);
				return ((REPOElement)val16).rectTransform;
			}, 10f, 0f);
			object obj3 = <>c.<>9__12_3;
			if (obj3 == null)
			{
				ScrollViewBuilderDelegate val4 = delegate(Transform parent)
				{
					//IL_002c: Unknown result type (might be due to invalid IL or missing references)
					REPOButton val15 = MenuAPI.CreateREPOButton("Manual Set Position", (Action)ViewManualSetPosition, parent, new Vector2(33f, 190f));
					return ((REPOElement)val15).rectTransform;
				};
				<>c.<>9__12_3 = val4;
				obj3 = (object)val4;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 13f, 0f);
			object obj4 = <>c.<>9__12_4;
			if (obj4 == null)
			{
				ScrollViewBuilderDelegate val5 = delegate(Transform parent)
				{
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					REPOSlider val14 = MenuAPI.CreateREPOSlider("Size", "Minimap Size Height / Width", (Action<float>)delegate(float f)
					{
						ConfigValues.Width.Value = f;
						ConfigValues.Height.Value = f;
					}, parent, new Vector2(0f, 150f), 100f, 800f, 0, Mathf.Max(ConfigValues.Width.Value, ConfigValues.Height.Value), "", "", (BarBehavior)0);
					return ((REPOElement)val14).rectTransform;
				};
				<>c.<>9__12_4 = val5;
				obj4 = (object)val5;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 13f, 0f);
			object obj5 = <>c.<>9__12_5;
			if (obj5 == null)
			{
				ScrollViewBuilderDelegate val6 = delegate(Transform parent)
				{
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					REPOSlider val13 = MenuAPI.CreateREPOSlider("Zoom Level", "Minimap Zoom Level", (Action<float>)delegate(float f)
					{
						ConfigValues.Zoom.Value = f;
					}, parent, new Vector2(0f, 150f), 1.5f, 10f, 2, ConfigValues.Zoom.Value, "", "", (BarBehavior)0);
					return ((REPOElement)val13).rectTransform;
				};
				<>c.<>9__12_5 = val6;
				obj5 = (object)val6;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 15f, 0f);
			object obj6 = <>c.<>9__12_6;
			if (obj6 == null)
			{
				ScrollViewBuilderDelegate val7 = delegate(Transform parent)
				{
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					REPOSlider val12 = MenuAPI.CreateREPOSlider("Opacity", "Minimap Opacity", (Action<float>)delegate(float f)
					{
						ConfigValues.Opacity.Value = f;
					}, parent, new Vector2(0f, 150f), 0f, 1f, 2, ConfigValues.Opacity.Value, "", "", (BarBehavior)0);
					return ((REPOElement)val12).rectTransform;
				};
				<>c.<>9__12_6 = val7;
				obj6 = (object)val7;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 15f, 0f);
			object obj7 = <>c.<>9__12_7;
			if (obj7 == null)
			{
				ScrollViewBuilderDelegate val8 = delegate(Transform parent)
				{
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					REPOToggle val11 = MenuAPI.CreateREPOToggle("Show Hint Text", (Action<bool>)delegate(bool b)
					{
						ConfigValues.EnabledHintText.Value = b;
					}, parent, new Vector2(0f, 90f), "Enabled", "Disabled", ConfigValues.EnabledHintText.Value);
					return ((REPOElement)val11).rectTransform;
				};
				<>c.<>9__12_7 = val8;
				obj7 = (object)val8;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 10f, 0f);
			object obj8 = <>c.<>9__12_8;
			if (obj8 == null)
			{
				ScrollViewBuilderDelegate val9 = delegate(Transform parent)
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					REPOLabel val10 = MenuAPI.CreateREPOLabel("Controls", parent, new Vector2(0f, 90f));
					return ((REPOElement)val10).rectTransform;
				};
				<>c.<>9__12_8 = val9;
				obj8 = (object)val9;
			}
			val.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 15f, 0f);
			foreach (ConfigEntry<KeyCode> item in BINDABLE_KEYS)
			{
				val.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform parent)
				{
					//IL_002a: 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_006c: Unknown result type (might be due to invalid IL or missing references)
					//IL_009e: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c4: 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_0104: 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_0129: Unknown result type (might be due to invalid IL or missing references)
					string key = ((ConfigEntryBase)item).Definition.Key;
					KeyCode value = item.Value;
					REPOButton element = MenuAPI.CreateREPOButton(key + ": " + ((object)(KeyCode)(ref value)).ToString(), (Action)delegate
					{
					}, parent, new Vector2(0f, 190f));
					element.onClick = delegate
					{
						//IL_0099: Unknown result type (might be due to invalid IL or missing references)
						//IL_009e: Unknown result type (might be due to invalid IL or missing references)
						if (!isSelectingKey)
						{
							((TMP_Text)element.labelTMP).text = ((ConfigEntryBase)item).Definition.Key + ": <PRESS ANY KEY>";
							keyToSet = item;
							activatedButton = element;
							isSelectingKey = true;
						}
						else
						{
							isSelectingKey = false;
							TextMeshProUGUI labelTMP = element.labelTMP;
							string key2 = ((ConfigEntryBase)item).Definition.Key;
							KeyCode value2 = item.Value;
							((TMP_Text)labelTMP).text = key2 + ": " + ((object)(KeyCode)(ref value2)).ToString();
						}
					};
					element.overrideButtonSize = new Vector2(element.GetLabelSize().x * 0.8f, element.GetLabelSize().y * 0.8f);
					((Transform)((REPOElement)element).rectTransform).localScale = new Vector3(((Transform)((REPOElement)element).rectTransform).localScale.x * 0.8f, ((Transform)((REPOElement)element).rectTransform).localScale.y * 0.8f, ((Transform)((REPOElement)element).rectTransform).localScale.z);
					return ((REPOElement)element).rectTransform;
				}, 0f, 0f);
			}
			pageInstance = val;
			val.OpenPage(false);
		}

		private static void ViewManualSetPosition()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			if (!StateUtils.IsInLevel())
			{
				MenuAPI.OpenPopup("Head into a level", Color.yellow, "You can only set the manual position of the minimap whilst on a level!", (Action)delegate
				{
				}, (Action)null);
			}
			else
			{
				if (isInManualMode || (Object)(object)pageInstance == (Object)null)
				{
					return;
				}
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor((float)(Screen.width * -3), (float)(Screen.height * -3));
				((Transform)pageInstance.rectTransform).localPosition = Vector2.op_Implicit(val);
				pageInstance.pageDimmerVisibility = false;
				Transform val2 = ((Component)pageInstance).gameObject.transform.Find("Menu Button - Back");
				if ((Object)(object)val2 != (Object)null)
				{
					val2.localPosition = Vector2.op_Implicit(val);
				}
				isSelectingPosition = true;
				isInManualMode = true;
				REPOPopupPage val3 = MenuAPI.CreateREPOPopupPage("Minimap", false, false, 0f, (Vector2?)val);
				object obj = <>c.<>9__13_1;
				if (obj == null)
				{
					BuilderDelegate val4 = delegate(Transform parent)
					{
						//IL_002f: Unknown result type (might be due to invalid IL or missing references)
						MenuAPI.CreateREPOButton("Apply", (Action)delegate
						{
							isSelectingPosition = false;
							isInManualMode = false;
							View();
						}, parent, new Vector2(66f, 18f));
					};
					<>c.<>9__13_1 = val4;
					obj = (object)val4;
				}
				val3.AddElement((BuilderDelegate)obj);
				val3.OpenPage(true);
			}
		}
	}
	internal static class StateUtils
	{
		internal static bool HasLocalMapToolActive()
		{
			PlayerAvatar instance = PlayerAvatar.instance;
			return (Object)(object)instance != (Object)null && (Object)(object)instance.playerAvatarVisuals.playerAvatarRightArm.mapToolController != (Object)null && instance.playerAvatarVisuals.playerAvatarRightArm.mapToolController.Active;
		}

		internal static bool IsInLevel()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			return SemiFunc.RunIsLevel() && (Object)(object)GameDirector.instance != (Object)null && (int)GameDirector.instance.currentState == 2;
		}

		internal static bool IsChatActive()
		{
			return (Object)(object)ChatManager.instance != (Object)null && ChatManager.instance.chatActive;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Minimap";

		public const string PLUGIN_NAME = "Minimap";

		public const string PLUGIN_VERSION = "1.1.3";
	}
}