Decompiled source of BodyReplacer v1.0.0

plugins/BodyReplacer.dll

Decompiled 6 hours ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GUIFramework;
using HarmonyLib;
using Jotunn;
using Jotunn.Entities;
using Jotunn.Extensions;
using Jotunn.Managers;
using Jotunn.Utils;
using MagicMike.ModSettings;
using MagicaCloth2;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("BodyReplacer")]
[assembly: AssemblyDescription("https://discord.gg/mnr36G6J4x")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MagicMike")]
[assembly: AssemblyProduct("BodyReplacer")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6b1f0c52-3d8e-4a47-9a21-5c7e2f90d4b3")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[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 MagicMike.ModSettings
{
	internal static class ConfigRounding
	{
		internal const int DefaultDecimals = 2;

		private static readonly Dictionary<ConfigFile, int> s_files = new Dictionary<ConfigFile, int>();

		private static readonly Dictionary<ConfigEntryBase, int> s_entries = new Dictionary<ConfigEntryBase, int>();

		private static bool s_writing;

		internal static void RoundAll(ConfigFile config, int decimals = 2)
		{
			if (config == null)
			{
				return;
			}
			if (!s_files.ContainsKey(config))
			{
				config.SettingChanged += OnSettingChanged;
			}
			s_files[config] = Math.Max(0, decimals);
			bool flag = false;
			foreach (ConfigEntryBase value in ((IDictionary<ConfigDefinition, ConfigEntryBase>)config).Values)
			{
				flag |= Normalize(value);
			}
			SaveIfNeeded(config, flag);
		}

		internal static void Round(ConfigEntryBase entry, int decimals)
		{
			if (entry != null)
			{
				s_entries[entry] = Math.Max(0, decimals);
				SaveIfNeeded(entry.ConfigFile, Normalize(entry));
			}
		}

		private static void OnSettingChanged(object sender, SettingChangedEventArgs args)
		{
			if (!s_writing && ((args != null) ? args.ChangedSetting : null) != null)
			{
				Normalize(args.ChangedSetting);
			}
		}

		private static bool Normalize(ConfigEntryBase entry)
		{
			if (entry == null || (entry.SettingType != typeof(float) && entry.SettingType != typeof(double)))
			{
				return false;
			}
			if (!s_entries.TryGetValue(entry, out var value) && (entry.ConfigFile == null || !s_files.TryGetValue(entry.ConfigFile, out value)))
			{
				return false;
			}
			double num = Convert.ToDouble(entry.BoxedValue);
			double num2 = ((double.IsNaN(num) || double.IsInfinity(num)) ? Convert.ToDouble(entry.DefaultValue) : Math.Round(num, Math.Min(value, 15), MidpointRounding.AwayFromZero));
			object obj = ((entry.SettingType == typeof(float)) ? ((object)(float)num2) : ((object)num2));
			ConfigDescription description = entry.Description;
			AcceptableValueBase val = ((description != null) ? description.AcceptableValues : null);
			if (val != null)
			{
				obj = val.Clamp(obj);
			}
			if (object.Equals(obj, entry.BoxedValue))
			{
				return false;
			}
			s_writing = true;
			try
			{
				entry.BoxedValue = obj;
			}
			finally
			{
				s_writing = false;
			}
			return true;
		}

		private static void SaveIfNeeded(ConfigFile config, bool changed)
		{
			if (changed && config != null && !config.SaveOnConfigSet)
			{
				config.Save();
			}
		}
	}
	internal sealed class ResetIcon : MaskableGraphic
	{
		private const int Segments = 28;

		protected override void OnPopulateMesh(VertexHelper vh)
		{
			//IL_0007: 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)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: 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_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: 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_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			vh.Clear();
			Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect();
			Vector2 center = ((Rect)(ref pixelAdjustedRect)).center;
			float num = Mathf.Min(((Rect)(ref pixelAdjustedRect)).width, ((Rect)(ref pixelAdjustedRect)).height) * 0.36f;
			float num2 = num * 0.3f;
			for (int i = 0; i < 28; i++)
			{
				float angle = Mathf.Lerp(60f, 330f, (float)i / 28f) * ((float)Math.PI / 180f);
				float angle2 = Mathf.Lerp(60f, 330f, (float)(i + 1) / 28f) * ((float)Math.PI / 180f);
				Quad(vh, Polar(center, num + num2 * 0.5f, angle), Polar(center, num + num2 * 0.5f, angle2), Polar(center, num - num2 * 0.5f, angle2), Polar(center, num - num2 * 0.5f, angle));
			}
			float num3 = 5.7595863f;
			Vector2 val = Polar(center, num, num3);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0f - Mathf.Sin(num3), Mathf.Cos(num3));
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(Mathf.Cos(num3), Mathf.Sin(num3));
			float num4 = num2 * 2.2f;
			Triangle(vh, val + val2 * num4, val + val3 * num4 * 0.9f, val - val3 * num4 * 0.9f);
		}

		private static Vector2 Polar(Vector2 centre, float radius, float angle)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			return centre + new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * radius;
		}

		private void Quad(VertexHelper vh, Vector2 a, Vector2 b, Vector2 c, Vector2 d)
		{
			//IL_0009: 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_0019: 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)
			int currentVertCount = vh.currentVertCount;
			Vertex(vh, a);
			Vertex(vh, b);
			Vertex(vh, c);
			Vertex(vh, d);
			vh.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
			vh.AddTriangle(currentVertCount, currentVertCount + 2, currentVertCount + 3);
		}

		private void Triangle(VertexHelper vh, Vector2 a, Vector2 b, Vector2 c)
		{
			//IL_0009: 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_0019: Unknown result type (might be due to invalid IL or missing references)
			int currentVertCount = vh.currentVertCount;
			Vertex(vh, a);
			Vertex(vh, b);
			Vertex(vh, c);
			vh.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
		}

		private void Vertex(VertexHelper vh, Vector2 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			UIVertex simpleVert = UIVertex.simpleVert;
			simpleVert.position = Vector2.op_Implicit(position);
			simpleVert.color = Color32.op_Implicit(((Graphic)this).color);
			vh.AddVert(simpleVert);
		}
	}
	internal sealed class DownArrowIcon : MaskableGraphic
	{
		protected override void OnPopulateMesh(VertexHelper vh)
		{
			//IL_0007: 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)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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)
			vh.Clear();
			Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect();
			UIVertex simpleVert = UIVertex.simpleVert;
			simpleVert.color = Color32.op_Implicit(((Graphic)this).color);
			simpleVert.position = Vector2.op_Implicit(new Vector2(((Rect)(ref pixelAdjustedRect)).xMin, ((Rect)(ref pixelAdjustedRect)).yMax));
			vh.AddVert(simpleVert);
			simpleVert.position = Vector2.op_Implicit(new Vector2(((Rect)(ref pixelAdjustedRect)).xMax, ((Rect)(ref pixelAdjustedRect)).yMax));
			vh.AddVert(simpleVert);
			simpleVert.position = Vector2.op_Implicit(new Vector2(((Rect)(ref pixelAdjustedRect)).center.x, ((Rect)(ref pixelAdjustedRect)).yMin));
			vh.AddVert(simpleVert);
			vh.AddTriangle(0, 1, 2);
		}
	}
	internal sealed class CloseIcon : MaskableGraphic
	{
		protected override void OnPopulateMesh(VertexHelper vh)
		{
			//IL_0007: 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)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			vh.Clear();
			Rect pixelAdjustedRect = ((Graphic)this).GetPixelAdjustedRect();
			Vector2 center = ((Rect)(ref pixelAdjustedRect)).center;
			float num = Mathf.Min(((Rect)(ref pixelAdjustedRect)).width, ((Rect)(ref pixelAdjustedRect)).height) * 0.5f;
			float thickness = Mathf.Max(2f, num * 0.28f);
			Bar(vh, center + new Vector2(0f - num, 0f - num), center + new Vector2(num, num), thickness);
			Bar(vh, center + new Vector2(0f - num, num), center + new Vector2(num, 0f - num), thickness);
		}

		private void Bar(VertexHelper vh, Vector2 from, Vector2 to, float thickness)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_007e: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = to - from;
			float num = 0f - ((Vector2)(ref val)).normalized.y;
			val = to - from;
			Vector2 val2 = new Vector2(num, ((Vector2)(ref val)).normalized.x) * (thickness * 0.5f);
			int currentVertCount = vh.currentVertCount;
			UIVertex simpleVert = UIVertex.simpleVert;
			simpleVert.color = Color32.op_Implicit(((Graphic)this).color);
			simpleVert.position = Vector2.op_Implicit(from + val2);
			vh.AddVert(simpleVert);
			simpleVert.position = Vector2.op_Implicit(to + val2);
			vh.AddVert(simpleVert);
			simpleVert.position = Vector2.op_Implicit(to - val2);
			vh.AddVert(simpleVert);
			simpleVert.position = Vector2.op_Implicit(from - val2);
			vh.AddVert(simpleVert);
			vh.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
			vh.AddTriangle(currentVertCount, currentVertCount + 2, currentVertCount + 3);
		}
	}
	internal static class LinkIcons
	{
		private static Sprite s_discord;

		private static Sprite s_payPal;

		private const int Size = 30;

		private const string DiscordPixels = "NSMc/zUjHP81Ixz/XE5V/7Ots//X1uT/2Nv5/8rO+/+6v/n/srf4/6yy9/+rsPj/qq/4/6mv+P+pr/j/qa/4/6mv+P+qr/j/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6v3/0dLs/1Fc+P9bZfj/W2X4/1tl+P9WYPj/Vl/3/4CI9v/Bxfn/9/j8/5GY9f9VX/j/WGL4/1Vf+P9TXvj/U174/1Rf+P9XYvj/WGL4/32G9f/4+fz/y875/5CW9v9YYvb/VF74/1tl+P9bZfj/W2X4/1Fb+P/N0vr/ycz0/1Nd+P9bZfj/W2X4/1Zg+P9ze/X/zND4//z8/f///////////9/h+P9MWPX/Zm/2/3yE9/+Ij/f/iI/3/36H9v9rdPb/WGP2/7m+9////////////////v/X2vr/hIz2/1Nd9/9bZfj/W2X4/1Nd+P+8wvn/wsb4/1Ne+P9bZfj/W2X4/4yU9v/29vz/////////////////zND2/6mu9f/U1/r/8PL9//7//f/////////+/////v/19vz/2dz6/66z9v+2u/X////////////////////9/6yx9v9TXvf/W2X4/1Ne+P+yuPn/vsL3/1Re+P9bZfj/W2X4/7S4+P//////////////////////+vr9//7+///////////////////////////////////////////////////29/3//////////////////////+rr/P9QW/X/W2X4/1Re+P+ts/n/vMD3/1Rf+P9bZfj/W2X4/7e8+P///////////////////////////////v/2+Pz//v7+//////////////////////////7/9/f8//39/v///////////////////////////+zt/f9TXfb/W2X4/1Re+P+qsfn/u7/2/1Rf+P9bZfj/W2X4/7O3+P/////////////////////////9/56j9v9ocfb/kpj1/////v///////////////v+qr/b/aXP2/4mQ9v/9/f3//////////////////////+nq/f9QW/b/W2X4/1Ve9/+psPr/ur/2/1Rf+P9bZfj/W2X4/6ar9///////////////////////zND5/1Zg+P9XYfj/SVX3/8nL9////////////9rd+/9bZff/V2L4/0pV9/+4vfb//////////////////////9fZ+v9QWvf/W2X4/1Ve+P+or/r/u7/3/1Rf+P9bZfj/W2X4/5KZ9//+/v7/////////////////vsP5/1hi+P9bZfj/T1r4/7K39f///////////9DS+v9bZff/W2T4/1Fb+P+gpvT//////////////////////7a69v9SXfj/W2X4/1Ve+P+pr/r/u7/3/1Rf+P9bZfj/W2X4/3mB9//29v7/////////////////9Pb8/3Z+9P9SXPb/Z3H0//b3+/////////////n5/f+Civb/Ul32/2Bq9P/u7/v//////////////////////4WM9f9WYfj/W2X4/1Ve+P+pr/r/ur/2/1Rf+P9bZfj/W2X4/1lk9v/q6/v///////////////////////T1+//O0fn/8PH7///////////////////////4+f3/z9L5/+vt+//////////////////////////9/1Re9v9bZfj/W2X4/1Ve+P+pr/r/u7/3/1Rf+P9bZfj/W2X4/1Fc+P+zuPb/////////////////////////////////////////////////////////////////////////////////////////////////ycz3/1Re+P9bZfj/W2X4/1Re9/+psPn/vMD3/1Rf+P9bZfj/W2X4/1lj+P9hbPT////+//////////////////////////////////////////////////////////////////////////////////////////7/g4v2/1pk+P9bZfj/W2X4/1Re9/+qsfr/vsL4/1Re+P9bZfj/W2X4/1tl+P9TXfj/u8D2///////////////////////////////////////////////////////////////////////////////////////Z2/r/YGj3/1tl+P9bZfj/W2X4/1Re+P+ts/n/w8f3/1Ne+P9bZfj/W2X4/1tl+P9bZfj/bnb1//Hy/P////////////////////////////////////////////////////////////////////////////////+FjfX/V2H4/1tl+P9bZfj/W2X4/1Ne+P+zuPn/ycz0/1Jd+P9bZfj/W2X4/1tl+P9bZfj/WGL3/6Gn9f/39/z/////////////////9fb9//P0/P/5+f3/+fr9//P0/f/z9fz//////////////////P39/7/D9/9PWff/W2X4/1tl+P9bZfj/W2X4/1Nd+P+9wvn/0tPu/1Fb+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1Rg9/9vd/b/n6X3/83R+f/x8vv/kZj1/2dw9v9wefb/cHn2/2Zw9v94gfT/+fn8/9fZ+v+mrPj/dX72/1Zg9/9bZvj/W2X4/1tl+P9bZfj/W2X4/1Fb+P/P0/r/4eDk/0xX9/9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9XYvj/UVz4/1Vf9v9ibPf/WmT4/1hi+P9WYfj/VmH4/1hi+P9VX/j/Zm/3/1hi9/9RXPf/VmD4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1Jc9v/n6v3/4N3X/15o9P9a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/wsb4/1Ne+P9bZfj/W2X4/4yU9v/29vz/////////////////zND2/6mu9f/U1/r/8PL9//7//f/////////+/////v/19vz/2dz6/66z9v+2u/X////////////////////9/6yx9v9TXvf/W2X4/1Ne+P+yuPn/vsL3/1Re+P9bZfj/W2X4/7S4+P//////////////////////+vr9//7+///////////////////////////////////////////////////29/3//////////////////////+rr/P9QW/X/W2X4/1Re+P+ts/n/vMD3/1Rf+P9bZfj/W2X4/7e8+P///////////////////////////////v/2+Pz//v7+//////////////////////////7/9/f8//39/v///////////////////////////+zt/f9TXfb/W2X4/1Re+P+qsfn/u7/2/1Rf+P9bZfj/W2X4/7O3+P/////////////////////////9/56j9v9ocfb/kpj1/////v///////////////v+qr/b/aXP2/4mQ9v/9/f3//////////////////////+nq/f9QW/b/W2X4/1Ve9/+psPr/ur/2/1Rf+P9bZfj/W2X4/6ar9///////////////////////zND5/1Zg+P9XYfj/SVX3/8nL9////////////9rd+/9bZff/V2L4/0pV9/+4vfb//////////////////////9fZ+v9QWvf/W2X4/1Ve+P+or/r/u7/3/1Rf+P9bZfj/W2X4/5KZ9//+/v7/////////////////vsP5/1hi+P9bZfj/T1r4/7K39f///////////9DS+v9bZff/W2T4/1Fb+P+gpvT//////////////////////7a69v9SXfj/W2X4/1Ve+P+pr/r/u7/3/1Rf+P9bZfj/W2X4/3mB9//29v7/////////////////9Pb8/3Z+9P9SXPb/Z3H0//b3+/////////////n5/f+Civb/Ul32/2Bq9P/u7/v//////////////////////4WM9f9WYfj/W2X4/1Ve+P+pr/r/ur/2/1Rf+P9bZfj/W2X4/1lk9v/q6/v///////////////////////T1+//O0fn/8PH7///////////////////////4+f3/z9L5/+vt+//////////////////////////9/1Re9v9bZfj/W2X4/1Ve+P+pr/r/u7/3/1Rf+P9bZfj/W2X4/1Fc+P+zuPb/////////////////////////////////////////////////////////////////////////////////////////////////ycz3/1Re+P9bZfj/W2X4/1Re9/+psPn/vMD3/1Rf+P9bZfj/W2X4/1lj+P9hbPT////+//////////////////////////////////////////////////////////////////////////////////////////7/g4v2/1pk+P9bZfj/W2X4/1Re9/+qsfr/vsL4/1Re+P9bZfj/W2X4/1tl+P9TXfj/u8D2///////////////////////////////////////////////////////////////////////////////////////Z2/r/YGj3/1tl+P9bZfj/W2X4/1Re+P+ts/n/w8f3/1Ne+P9bZfj/W2X4/1tl+P9bZfj/bnb1//Hy/P////////////////////////////////////////////////////////////////////////////////+FjfX/V2H4/1tl+P9bZfj/W2X4/1Ne+P+zuPn/ycz0/1Jd+P9bZfj/W2X4/1tl+P9bZfj/WGL3/6Gn9f/39/z/////////////////9fb9//P0/P/5+f3/+fr9//P0/f/z9fz//////////////////P39/7/D9/9PWff/W2X4/1tl+P9bZfj/W2X4/1Nd+P+9wvn/0tPu/1Fb+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1Rg9/9vd/b/n6X3/83R+f/x8vv/kZj1/2dw9v9wefb/cHn2/2Zw9v94gfT/+fn8/9fZ+v+mrPj/dX72/1Zg9/9bZvj/W2X4/1tl+P9bZfj/W2X4/1Fb+P/P0/r/4eDk/0xX9/9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9XYvj/UVz4/1Vf9v9ibPf/WmT4/1hi+P9WYfj/VmH4/1hi+P9VX/j/Zm/3/1hi9/9RXPf/VmD4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1Jc9v/n6v3/4N3X/15o9P9aZPj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9YY/j/WmX4/1tl+P9bZfj/W2X4/1tl+P9bZfj/WGL4/1pk+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/2Vv9v/z9f//pZ6k/6mu9v9SXPj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/4mR9//Gwc//Rjc4//Lz/f9lbvX/WGL4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9ZY/j/VF/3/9nc+v9fUFz/NSMc/4J7g//W2vr/Y232/1Fb+P9WYPj/WWP4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9bZfj/W2X4/1tl+P9aZPj/WGL4/1Jc+P9ZY/b/v8T6/62lrf84JyL/NSMc/zcmIP+If4b/5Ob3/6Cm+P9zfPf/XWj3/1Zh9/9UXvf/Ul33/1Jd9/9SXff/Ulz3/1Jc9/9SXPf/Ulz3/1Jc9/9SXPf/Ulz3/1Jd+P9TXff/U173/1Zg9/9dZ/f/bHb3/5mg+f/d4fr/q6Kr/zooJf81Ixz/NSMc/zUjHP81Ixz/U0VH/6afpP/NzNT/29zz/9TX+v/Hy/n/v8T6/7q/+f+4vfn/trv3/7a79/+2u/f/trr3/7a89/+4vPj/uLz4/7q++v+/w/r/x8r5/9LW+//d3/b/1tTh/6ylrf9fUFn/NiQe/zUjHP81Ixz/");
				}
				return s_discord;
			}
		}

		public static Sprite PayPal
		{
			get
			{
				if (!((Object)(object)s_payPal != (Object)null))
				{
					return s_payPal = Load("PayPal", "NSMc/zUjHP81Ixz/OCUf/0o7PP9yZm//npag/7i0wP/GxND/zMrZ/8/M3f/Qz9//0dDi/9HQ4f/R0OL/0dDi/9HQ4v/Rz+L/0c/i/8/N3v/Oy9v/yMbU/764x/+nnqz/fG58/1RES/89LCf/NSMc/zUjHP81Ixz/NSMc/zMhGf9DMzD/j4WN/9bW7f/Cx///l5/6/4KK+f91fvj/bXb3/2hy9v9ocff/Z3D3/2Zw9/9mcPf/ZnD3/2Zw9/9ncPf/Z3D3/2hy9v9tdvb/dH34/3+I+f+Sm/v/uMD+/9zd9/+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v7fB/1FBQf85JyL/NSMc/zMhGv8/Lir/g3l8/9PR4//Jzv7/oaj7/4yT+v9+hvj/eID4/3R89/9xevf/b3j2/2549v9uePb/b3j2/2949v9wevb/cXr3/3R8+P94gPn/fYb4/4qR+/+epPr/xcr//9nb7/+VjJb/RDM0/zMiGv81Ixz/NSMc/zUjHP81Ixz/NyUd/0c3Nf9pXWD/jIaM/6qnsP/BvMf/yMXQ/8vK1P/PzNn/0c7b/9PQ3P/Tz9z/08/c/9DO2//Mydf/y8rX/8vK1v/Jx9P/wLvH/62psv+Uipb/bmFr/0o5O/84JiD/NSMc/zUjHP81Ixz/");
				}
				return s_payPal;
			}
		}

		private static Sprite Load(string name, string pixels)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			Texture2D val = new Texture2D(30, 30, (TextureFormat)4, false)
			{
				name = "MagicMike " + name
			};
			val.LoadRawTextureData(Convert.FromBase64String(pixels));
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, 30f, 30f), new Vector2(0.5f, 0.5f));
		}
	}
	internal static class ModSettings
	{
		internal const int Version = 35;

		internal const string GuidPrefix = "MagicMike.";

		private const string HostKey = "MagicMike.ModSettings.Host";

		private const string VersionKey = "MagicMike.ModSettings.Version";

		private static readonly string s_id = typeof(ModSettings).Assembly.GetName().Name;

		private static bool s_initialised;

		private static ConfigEntry<float> s_panelX;

		private static ConfigEntry<float> s_panelY;

		internal static ConfigFile Config { get; private set; }

		internal static ConfigEntry<KeyboardShortcut> ToggleKey { get; private set; }

		internal static ConfigEntry<float> ScrollSpeed { get; private set; }

		internal static Vector2 PanelPosition
		{
			get
			{
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				if (s_panelX == null)
				{
					return Vector2.zero;
				}
				return new Vector2(s_panelX.Value, s_panelY.Value);
			}
			set
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				if (s_panelX != null)
				{
					s_panelX.Value = value.x;
					s_panelY.Value = value.y;
				}
			}
		}

		internal static bool IsHost => AppDomain.CurrentDomain.GetData("MagicMike.ModSettings.Host") as string == s_id;

		public static void Init(BaseUnityPlugin plugin)
		{
			if (!s_initialised)
			{
				s_initialised = true;
				AppDomain currentDomain = AppDomain.CurrentDomain;
				if (!(currentDomain.GetData("MagicMike.ModSettings.Version") is int num) || 35 > num)
				{
					currentDomain.SetData("MagicMike.ModSettings.Version", 35);
					currentDomain.SetData("MagicMike.ModSettings.Host", s_id);
				}
				((Component)plugin).gameObject.AddComponent<ModSettingsDriver>();
			}
		}

		internal static void StartHost()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0033: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Expected O, but got Unknown
			Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "MagicMike.ModSettings.cfg"), true);
			ToggleKey = Config.Bind<KeyboardShortcut>("General", "Toggle Key", new KeyboardShortcut((KeyCode)288, Array.Empty<KeyCode>()), "The key that opens and closes the Mod Settings panel.");
			ScrollSpeed = Config.Bind<float>("General", "Scroll Speed", 3f, new ConfigDescription("How many setting rows the list moves for each notch of the mouse wheel.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			s_panelX = Config.Bind<float>("General", "Panel Position X", 0f, new ConfigDescription("Where the panel was last dragged to, across from the centre of the screen.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
			{
				Browsable = false
			} }));
			s_panelY = Config.Bind<float>("General", "Panel Position Y", 0f, new ConfigDescription("Where the panel was last dragged to, up from the centre of the screen.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
			{
				Browsable = false
			} }));
			Harmony val = new Harmony("MagicMike.ModSettings");
			val.Patch((MethodBase)AccessTools.Method(typeof(Menu), "Update", (Type[])null, (Type[])null), new HarmonyMethod(typeof(ModSettings), "MenuUpdatePrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)AccessTools.Method(typeof(ZInput), "GetMouseScrollWheel", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(ModSettings), "MouseScrollPostfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		private static bool MenuUpdatePrefix()
		{
			return !SettingsPanel.IsOpen;
		}

		private static void MouseScrollPostfix(ref float __result)
		{
			if (SettingsPanel.IsOpen)
			{
				__result = 0f;
			}
		}
	}
	internal sealed class ModSettingsDriver : MonoBehaviour
	{
		private SettingsPanel m_panel;

		private void Start()
		{
			if (!ModSettings.IsHost)
			{
				Object.Destroy((Object)(object)this);
			}
			else
			{
				ModSettings.StartHost();
			}
		}

		private void Update()
		{
			//IL_000c: 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)
			if (ModSettings.ToggleKey == null)
			{
				return;
			}
			KeyboardShortcut value = ModSettings.ToggleKey.Value;
			if (!((KeyboardShortcut)(ref value)).IsDown() || IsTyping() || ((Object)(object)m_panel != (Object)null && m_panel.IsCapturingKey))
			{
				return;
			}
			if ((Object)(object)m_panel == (Object)null)
			{
				if (GUIManager.IsHeadless() || (Object)(object)GUIManager.CustomGUIFront == (Object)null)
				{
					return;
				}
				m_panel = SettingsPanel.Create();
			}
			m_panel.Toggle();
		}

		private static bool IsTyping()
		{
			if (SettingsPanel.IsOpen)
			{
				return false;
			}
			if (!Console.IsVisible() && !TextInput.IsVisible() && (!((Object)(object)Chat.instance != (Object)null) || !Chat.instance.HasFocus()))
			{
				return TextBoxFocused();
			}
			return true;
		}

		private static bool TextBoxFocused()
		{
			GameObject val = (((Object)(object)EventSystem.current != (Object)null) ? EventSystem.current.currentSelectedGameObject : null);
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			TMP_InputField component = val.GetComponent<TMP_InputField>();
			if ((Object)(object)component != (Object)null && component.isFocused)
			{
				return true;
			}
			InputField component2 = val.GetComponent<InputField>();
			if ((Object)(object)component2 != (Object)null)
			{
				return component2.isFocused;
			}
			return false;
		}
	}
	internal sealed class SettingRow
	{
		public const float RowHeight = 40f;

		private const float ResetSize = 28f;

		private const float NumberWidth = 76f;

		public readonly SettingInfo Setting;

		public readonly GameObject Root;

		private readonly SettingsPanel m_panel;

		private readonly Image m_background;

		private readonly TMP_Text m_label;

		private readonly Button m_reset;

		private Toggle m_toggle;

		private Slider m_slider;

		private TMP_InputField m_input;

		private TMP_Dropdown m_dropdown;

		private Button m_keyButton;

		private TMP_Text m_keyLabel;

		private object[] m_choices;

		private Color m_stripe = Theme.RowEven;

		private bool m_hovered;

		private bool m_refreshing;

		private ConfigEntryBase Entry => Setting.Entry;

		public bool IsDefault => object.Equals(Entry.BoxedValue, Entry.DefaultValue);

		public SettingRow(SettingsPanel panel, Transform parent, SettingInfo setting)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: 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_020d: Expected O, but got Unknown
			m_panel = panel;
			Setting = setting;
			Root = Widgets.Row(parent, 40f);
			m_background = Root.AddComponent<Image>();
			((Graphic)m_background).color = m_stripe;
			HoverRelay hoverRelay = Root.AddComponent<HoverRelay>();
			hoverRelay.OnEnter = delegate
			{
				SetHovered(hovered: true);
			};
			hoverRelay.OnExit = delegate
			{
				SetHovered(hovered: false);
			};
			m_label = Widgets.Label(Root.transform, "", 20f, Theme.Text, (TextAlignmentOptions)4097);
			m_label.enableAutoSizing = true;
			m_label.fontSizeMin = 14f;
			m_label.fontSizeMax = 20f;
			Widgets.Place(((Component)m_label).gameObject, new Vector2(0f, 0f), new Vector2(0.42f, 1f), new Vector2(12f, 2f), new Vector2(-8f, -2f));
			GameObject val = Widgets.Child(Root.transform, "Control");
			Widgets.Place(val, new Vector2(0.42f, 0f), new Vector2(1f, 1f), new Vector2(0f, 6f), new Vector2(-46f, -6f));
			BuildControl(val.transform);
			m_reset = Widgets.IconButton<ResetIcon>(Root.transform, 3f);
			Widgets.Place(((Component)m_reset).gameObject, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(-36f, -14f), new Vector2(-8f, 14f));
			((UnityEvent)m_reset.onClick).AddListener((UnityAction)delegate
			{
				SetValue(Entry.DefaultValue);
			});
			Refresh();
		}

		public bool Matches(string search)
		{
			if (!string.IsNullOrEmpty(search) && !Contains(Setting.Name, search) && !Contains(Setting.Section, search))
			{
				return Contains(Setting.Description, search);
			}
			return true;
		}

		public void SetStripe(bool odd)
		{
			//IL_000b: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			m_stripe = (odd ? Theme.RowOdd : Theme.RowEven);
			((Graphic)m_background).color = (m_hovered ? Theme.RowHover : m_stripe);
		}

		private void SetHovered(bool hovered)
		{
			//IL_0018: 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)
			m_hovered = hovered;
			((Graphic)m_background).color = (hovered ? Theme.RowHover : m_stripe);
			m_panel.ShowDescription(hovered ? this : null);
		}

		public void Refresh()
		{
			//IL_0030: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			bool isReadOnly = Setting.IsReadOnly;
			string text = (Setting.Synced ? ("  <size=70%><color=" + Theme.Tag(Theme.Muted) + ">" + (isReadOnly ? "server, locked" : "server") + "</color></size>") : "");
			m_label.text = Setting.Name + text;
			((Graphic)m_label).color = (isReadOnly ? Theme.Muted : Theme.Text);
			((Selectable)m_reset).interactable = !isReadOnly && !IsDefault;
			((Component)m_reset).gameObject.SetActive(!IsDefault);
			m_refreshing = true;
			try
			{
				object value = Entry.BoxedValue;
				if ((Object)(object)m_toggle != (Object)null)
				{
					Toggle toggle = m_toggle;
					bool flag = default(bool);
					int num;
					if (value is bool)
					{
						flag = (bool)value;
						num = 1;
					}
					else
					{
						num = 0;
					}
					toggle.SetIsOnWithoutNotify((byte)((uint)num & (flag ? 1u : 0u)) != 0);
					((Selectable)m_toggle).interactable = !isReadOnly;
				}
				if ((Object)(object)m_slider != (Object)null)
				{
					m_slider.SetValueWithoutNotify(Convert.ToSingle(value, CultureInfo.InvariantCulture));
					((Selectable)m_slider).interactable = !isReadOnly;
				}
				if ((Object)(object)m_dropdown != (Object)null)
				{
					m_dropdown.SetValueWithoutNotify(Math.Max(0, Array.FindIndex(m_choices, (object c) => object.Equals(c, value))));
					((Selectable)m_dropdown).interactable = !isReadOnly;
				}
				if ((Object)(object)m_input != (Object)null && !m_input.isFocused)
				{
					m_input.SetTextWithoutNotify(Format(value));
					((Selectable)m_input).interactable = !isReadOnly;
				}
				if ((Object)(object)m_keyButton != (Object)null)
				{
					m_keyLabel.text = (m_panel.IsCapturing(this) ? ("<color=" + Theme.Tag(Theme.AccentBright) + ">Press a key...</color>") : Format(value));
					((Selectable)m_keyButton).interactable = !isReadOnly;
				}
			}
			finally
			{
				m_refreshing = false;
			}
		}

		private void BuildControl(Transform parent)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Expected O, but got Unknown
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: 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_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: 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_0230: 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)
			Type settingType = Entry.SettingType;
			ConfigDescription description = Entry.Description;
			AcceptableValueBase acceptable = ((description != null) ? description.AcceptableValues : null);
			if (settingType == typeof(bool))
			{
				m_toggle = Widgets.Toggle(parent);
				Widgets.Place(((Component)m_toggle).gameObject, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(0f, -12f), new Vector2(24f, 12f));
				((UnityEvent<bool>)(object)m_toggle.onValueChanged).AddListener((UnityAction<bool>)delegate(bool on)
				{
					SetValue(on);
				});
				return;
			}
			if (settingType == typeof(KeyCode) || settingType == typeof(KeyboardShortcut))
			{
				m_keyButton = Widgets.Button(parent, "", 15f);
				Widgets.Place(((Component)m_keyButton).gameObject, Vector2.zero, Vector2.one, Vector2.zero, Vector2.zero);
				m_keyLabel = ((Component)m_keyButton).GetComponentInChildren<TMP_Text>(true);
				((UnityEvent)m_keyButton.onClick).AddListener((UnityAction)delegate
				{
					m_panel.StartCapture(this);
				});
				return;
			}
			object[] choices = GetChoices(settingType, acceptable);
			if (choices != null)
			{
				m_choices = choices;
				m_dropdown = Widgets.Dropdown(parent, 15f);
				Widgets.Place(((Component)m_dropdown).gameObject, Vector2.zero, Vector2.one, Vector2.zero, Vector2.zero);
				m_dropdown.options = ((IEnumerable<object>)choices).Select((Func<object, OptionData>)((object c) => new OptionData(Format(c)))).ToList();
				((UnityEvent<int>)(object)m_dropdown.onValueChanged).AddListener((UnityAction<int>)delegate(int i)
				{
					SetValue(m_choices[i]);
				});
				return;
			}
			if (IsNumber(settingType) && TryGetRange(acceptable, out var min, out var max))
			{
				m_slider = Widgets.Slider(parent);
				Widgets.Place(((Component)m_slider).gameObject, new Vector2(0f, 0f), new Vector2(1f, 1f), new Vector2(2f, 2f), new Vector2(-90f, -2f));
				m_slider.minValue = min;
				m_slider.maxValue = max;
				m_slider.wholeNumbers = IsWholeNumber(settingType);
				((UnityEvent<float>)(object)m_slider.onValueChanged).AddListener((UnityAction<float>)delegate(float v)
				{
					SetValue(v);
				});
			}
			m_input = Widgets.Input(parent, 15f);
			if ((Object)(object)m_slider != (Object)null)
			{
				Widgets.Place(((Component)m_input).gameObject, new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(-76f, 0f), Vector2.zero);
			}
			else
			{
				Widgets.Place(((Component)m_input).gameObject, Vector2.zero, Vector2.one, Vector2.zero, Vector2.zero);
			}
			m_input.contentType = (ContentType)(IsNumber(settingType) ? (IsWholeNumber(settingType) ? 2 : 3) : 0);
			((UnityEvent<string>)(object)m_input.onEndEdit).AddListener((UnityAction<string>)OnInputSubmitted);
		}

		private void OnInputSubmitted(string text)
		{
			if (m_refreshing)
			{
				return;
			}
			try
			{
				SetValue(TomlTypeConverter.ConvertToValue(text.Replace(',', '.'), Entry.SettingType));
			}
			catch (Exception)
			{
				Refresh();
			}
		}

		public void SetValue(object value)
		{
			if (m_refreshing || Setting.IsReadOnly)
			{
				return;
			}
			try
			{
				if (value != null && value.GetType() != Entry.SettingType && IsNumber(Entry.SettingType))
				{
					value = Convert.ChangeType(value, Entry.SettingType, CultureInfo.InvariantCulture);
				}
				Entry.BoxedValue = value;
			}
			catch (Exception ex)
			{
				Logger.LogWarning((object)("[ModSettings] Could not set " + Setting.Name + ": " + ex.Message));
			}
			Refresh();
		}

		private unsafe static string Format(object value)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			if (value != null)
			{
				if (!(value is float num))
				{
					if (!(value is double num2))
					{
						if (value is KeyboardShortcut val)
						{
							if ((int)((KeyboardShortcut)(ref val)).MainKey != 0)
							{
								return ((object)(*(KeyboardShortcut*)(&val))/*cast due to .constrained prefix*/).ToString();
							}
							return "None";
						}
						return Convert.ToString(value, CultureInfo.InvariantCulture);
					}
					return num2.ToString("0.###", CultureInfo.InvariantCulture);
				}
				return num.ToString("0.###", CultureInfo.InvariantCulture);
			}
			return "";
		}

		private static object[] GetChoices(Type type, AcceptableValueBase acceptable)
		{
			if (acceptable != null && ((object)acceptable).GetType().IsGenericType && ((object)acceptable).GetType().GetGenericTypeDefinition() == typeof(AcceptableValueList<>) && ((object)acceptable).GetType().GetProperty("AcceptableValues")?.GetValue(acceptable) is Array { Length: >0 } array)
			{
				return array.Cast<object>().ToArray();
			}
			if (type.IsEnum && !type.IsDefined(typeof(FlagsAttribute), inherit: false))
			{
				return Enum.GetValues(type).Cast<object>().Distinct()
					.ToArray();
			}
			return null;
		}

		private static bool TryGetRange(AcceptableValueBase acceptable, out float min, out float max)
		{
			min = (max = 0f);
			if (acceptable == null || !((object)acceptable).GetType().IsGenericType || ((object)acceptable).GetType().GetGenericTypeDefinition() != typeof(AcceptableValueRange<>))
			{
				return false;
			}
			min = Convert.ToSingle(((object)acceptable).GetType().GetProperty("MinValue").GetValue(acceptable), CultureInfo.InvariantCulture);
			max = Convert.ToSingle(((object)acceptable).GetType().GetProperty("MaxValue").GetValue(acceptable), CultureInfo.InvariantCulture);
			return max > min;
		}

		private static bool IsNumber(Type type)
		{
			if (!IsWholeNumber(type) && !(type == typeof(float)) && !(type == typeof(double)))
			{
				return type == typeof(decimal);
			}
			return true;
		}

		private static bool IsWholeNumber(Type type)
		{
			if (!(type == typeof(int)) && !(type == typeof(long)) && !(type == typeof(short)) && !(type == typeof(byte)) && !(type == typeof(uint)) && !(type == typeof(ulong)) && !(type == typeof(ushort)))
			{
				return type == typeof(sbyte);
			}
			return true;
		}

		private static bool Contains(string text, string search)
		{
			if (text != null)
			{
				return text.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0;
			}
			return false;
		}
	}
	internal sealed class ModInfo
	{
		public string Name;

		public string Version;

		public ConfigFile Config;

		public List<SettingInfo> Settings;
	}
	internal sealed class SettingInfo
	{
		public ConfigEntryBase Entry;

		public string Section;

		public string Name;

		public string Description;

		public bool Synced;

		public object Attributes;

		public bool IsReadOnly => SettingsDiscovery.GetField<bool?>(Attributes, "ReadOnly") == true;
	}
	internal static class SettingsDiscovery
	{
		private static readonly Regex s_sectionNumber = new Regex("^\\s*(\\d+)\\s*-\\s*");

		private static readonly Regex s_syncTag = new Regex("\\s*\\[(Not )?Synced with Server\\]\\s*$");

		public static List<ModInfo> FindMods()
		{
			List<ModInfo> list = new List<ModInfo>();
			foreach (PluginInfo value in Chainloader.PluginInfos.Values)
			{
				if (!((Object)(object)value.Instance == (Object)null) && value.Metadata.GUID.StartsWith("MagicMike.", StringComparison.OrdinalIgnoreCase))
				{
					list.Add(Describe(value.Metadata.Name, value.Metadata.Version.ToString(), value.Instance.Config));
				}
			}
			list.Sort((ModInfo a, ModInfo b) => string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase));
			if (ModSettings.Config != null)
			{
				list.Add(Describe("Mod Settings Panel", 35.ToString(), ModSettings.Config));
			}
			return list;
		}

		private static ModInfo Describe(string name, string version, ConfigFile config)
		{
			List<(SettingInfo, int, int, int)> list = new List<(SettingInfo, int, int, int)>();
			int num = 0;
			foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item3 in config)
			{
				ConfigEntryBase value = item3.Value;
				ConfigDescription description = value.Description;
				object obj = ((description == null) ? null : description.Tags?.FirstOrDefault((object t) => t != null && t.GetType().Name == "ConfigurationManagerAttributes"));
				if (GetField<bool?>(obj, "Browsable") != false)
				{
					Match match = s_sectionNumber.Match(value.Definition.Section);
					SettingInfo obj2 = new SettingInfo
					{
						Entry = value,
						Section = (match.Success ? value.Definition.Section.Substring(match.Length) : value.Definition.Section),
						Name = (GetField<string>(obj, "DispName") ?? value.Definition.Key)
					};
					Regex regex = s_syncTag;
					ConfigDescription description2 = value.Description;
					obj2.Description = regex.Replace(((description2 != null) ? description2.Description : null) ?? "", "").Trim();
					obj2.Synced = GetField<bool>(obj, "IsAdminOnly");
					obj2.Attributes = obj;
					SettingInfo item = obj2;
					int item2 = (match.Success ? int.Parse(match.Groups[1].Value) : int.MaxValue);
					list.Add((item, item2, GetField<int?>(obj, "Order").GetValueOrDefault(), num++));
				}
			}
			List<SettingInfo> settings = (from f in list.OrderBy<(SettingInfo, int, int, int), int>(((SettingInfo setting, int section, int order, int index) f) => f.section).ThenBy<(SettingInfo, int, int, int), string>(((SettingInfo setting, int section, int order, int index) f) => f.setting.Section, StringComparer.OrdinalIgnoreCase).ThenByDescending<(SettingInfo, int, int, int), int>(((SettingInfo setting, int section, int order, int index) f) => f.order)
					.ThenBy<(SettingInfo, int, int, int), int>(((SettingInfo setting, int section, int order, int index) f) => f.index)
				select f.setting).ToList();
			return new ModInfo
			{
				Name = name,
				Version = version,
				Config = config,
				Settings = settings
			};
		}

		public static T GetField<T>(object target, string name)
		{
			if (target == null)
			{
				return default(T);
			}
			Type type = target.GetType();
			object obj = type.GetField(name, BindingFlags.Instance | BindingFlags.Public)?.GetValue(target) ?? type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public)?.GetValue(target);
			if (obj is T)
			{
				return (T)obj;
			}
			return default(T);
		}
	}
	internal sealed class SettingsPanel : MonoBehaviour
	{
		private const float MaxWidth = 1040f;

		private const float MaxHeight = 760f;

		private const float Margin = 32f;

		private const float RefreshInterval = 1f;

		private const float ModTitleWidth = 300f;

		private const float SectionTop = 162f;

		private const float FooterHeight = 44f;

		private const string DiscordLink = "https://discord.gg/mnr36G6J4x";

		private const string PayPalLink = "https://www.paypal.com/donate/?hosted_button_id=BN8HEWHRMAREU";

		private const float SectionRowHeight = 32f;

		private const float SectionGap = 5f;

		private const int MaxSectionsPerRow = 7;

		private const int MaxTabsPerRow = 5;

		private const float TabTop = 74f;

		private const float TabRowHeight = 34f;

		private const float TabGap = 5f;

		private static readonly KeyCode[] s_modifiers;

		private static readonly KeyCode[] s_bindableKeys;

		private static string s_lastMod;

		private readonly List<SettingRow> m_rows = new List<SettingRow>();

		private readonly List<(GameObject header, List<SettingRow> rows)> m_sections = new List<(GameObject, List<SettingRow>)>();

		private readonly List<string> m_sectionNames = new List<string>();

		private readonly List<(Button button, TMP_Text label, GameObject header)> m_sectionButtons = new List<(Button, TMP_Text, GameObject)>();

		private RectTransform m_sectionBar;

		private GameObject m_shownSection;

		private GameObject m_jumpedTo;

		private float m_jumpedOffset;

		private readonly Dictionary<ConfigFile, bool> m_savedSaveOnSet = new Dictionary<ConfigFile, bool>();

		private readonly HashSet<ConfigFile> m_changedFiles = new HashSet<ConfigFile>();

		private readonly List<(Button button, TMP_Text label)> m_tabs = new List<(Button, TMP_Text)>();

		private List<ModInfo> m_mods = new List<ModInfo>();

		private ModInfo m_selected;

		private RectTransform m_tabBar;

		private float m_tabShift;

		private ScrollRect m_settingsList;

		private TMP_Text m_modTitle;

		private TMP_Text m_description;

		private TMP_Text m_hint;

		private TMP_Text m_empty;

		private TMP_InputField m_search;

		private RectTransform m_panel;

		private DragMove m_drag;

		private SettingRow m_capturing;

		private int m_captureFrame;

		private float m_nextRefresh;

		private bool m_inputFocusedLastFrame;

		private bool m_destroying;

		private static string DescriptionHint => "<color=" + Theme.Tag(Theme.Muted) + ">Hover over a setting to see what it does.</color>";

		public static bool IsOpen { get; private set; }

		public bool IsCapturingKey => m_capturing != null;

		public static SettingsPanel Create()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_0060: 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)
			Transform transform = GUIManager.CustomGUIFront.transform;
			Image val = Widgets.Box(transform, "MagicMikeModSettings", Theme.Dim);
			Widgets.Fill(((Component)val).gameObject);
			SettingsPanel settingsPanel = ((Component)val).gameObject.AddComponent<SettingsPanel>();
			Rect rect = ((RectTransform)transform).rect;
			Vector2 size = ((Rect)(ref rect)).size;
			settingsPanel.Build(Mathf.Min(1040f, size.x * 0.9f), Mathf.Min(760f, size.y * 0.9f));
			((Component)val).gameObject.SetActive(false);
			return settingsPanel;
		}

		private void Build(float width, float height)
		{
			//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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_0044: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: 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_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: 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_01a6: 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_01c4: 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_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: 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_023d: Expected O, but got Unknown
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Expected O, but got Unknown
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Expected O, but got Unknown
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Expected O, but got Unknown
			//IL_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_040e: Expected O, but got Unknown
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: 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_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0539: Unknown result type (might be due to invalid IL or missing references)
			//IL_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0633: Unknown result type (might be due to invalid IL or missing references)
			//IL_0642: Unknown result type (might be due to invalid IL or missing references)
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_0660: Unknown result type (might be due to invalid IL or missing references)
			//IL_0690: Unknown result type (might be due to invalid IL or missing references)
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_070b: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Unknown result type (might be due to invalid IL or missing references)
			Image val = Widgets.Box(((Component)this).transform, "Panel", Theme.Panel, Theme.PanelOutline, 2f);
			RectTransform val2 = (RectTransform)((Component)val).transform;
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(0.5f, 0.5f);
			val2.anchorMax = val3;
			val2.anchorMin = val3;
			val2.sizeDelta = new Vector2(width, height);
			Transform transform = ((Component)val).transform;
			m_panel = val2;
			m_drag = ((Component)val).gameObject.AddComponent<DragMove>();
			m_drag.Target = val2;
			m_drag.OnMoved = delegate(Vector2 position)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				ModSettings.PanelPosition = position;
			};
			Image obj = Widgets.Box(transform, "TitleBar", Theme.Header);
			Widgets.Place(((Component)obj).gameObject, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(12f, -66f), new Vector2(-12f, -12f));
			Widgets.Place(((Component)Widgets.Box(((Component)obj).transform, "Accent", Theme.Accent)).gameObject, new Vector2(0f, 0f), new Vector2(0f, 1f), Vector2.zero, new Vector2(4f, 0f));
			Widgets.Place(((Component)Widgets.Label(((Component)obj).transform, "Magic Mike's Mod Settings", 26f, Theme.TextBright, (TextAlignmentOptions)514, bold: true)).gameObject, Vector2.zero, Vector2.one, new Vector2(120f, 0f), new Vector2(-120f, 0f));
			Button obj2 = Widgets.IconButton<CloseIcon>(((Component)obj).transform, 9f);
			Widgets.Place(((Component)obj2).gameObject, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(-46f, -15f), new Vector2(-12f, 15f));
			((UnityEvent)obj2.onClick).AddListener(new UnityAction(Close));
			Button obj3 = Widgets.Button(((Component)obj).transform, "Re-centre", 14f);
			Widgets.Place(((Component)obj3).gameObject, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(16f, -15f), new Vector2(106f, 15f));
			((UnityEvent)obj3.onClick).AddListener(new UnityAction(ResetPosition));
			m_tabBar = (RectTransform)Widgets.Child(transform, "Tabs").transform;
			m_modTitle = Widgets.Label(transform, "", 20f, Theme.Text, (TextAlignmentOptions)4097, bold: true);
			m_modTitle.enableAutoSizing = true;
			m_modTitle.fontSizeMin = 14f;
			m_modTitle.fontSizeMax = 20f;
			m_modTitle.textWrappingMode = (TextWrappingModes)0;
			m_modTitle.overflowMode = (TextOverflowModes)1;
			m_search = Widgets.Input(transform, 17f, "Search settings...");
			m_search.textViewport.offsetMax = new Vector2(-46f, -2f);
			((UnityEvent<string>)(object)m_search.onValueChanged).AddListener((UnityAction<string>)delegate
			{
				ApplySearch();
			});
			Button obj4 = Widgets.IconButton<CloseIcon>(((Component)m_search).transform, 9f);
			Widgets.Place(((Component)obj4).gameObject, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(-38f, -15f), new Vector2(-4f, 15f));
			((UnityEvent)obj4.onClick).AddListener((UnityAction)delegate
			{
				m_search.text = "";
			});
			m_sectionBar = (RectTransform)Widgets.Child(transform, "Sections").transform;
			m_settingsList = Widgets.ScrollView(transform);
			Widgets.Place(((Component)m_settingsList).gameObject, Vector2.zero, Vector2.one, new Vector2(32f, 210f), new Vector2(-32f, -204f));
			m_empty = Widgets.Label((Transform)(object)m_settingsList.viewport, "No settings match your search.", 17f, Theme.Muted, (TextAlignmentOptions)514);
			Widgets.Place(((Component)m_empty).gameObject, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0f, -60f), new Vector2(0f, -20f));
			((Component)m_empty).gameObject.SetActive(false);
			Image val4 = Widgets.Box(transform, "Description", Theme.Field, Theme.FieldOutline);
			Widgets.Place(((Component)val4).gameObject, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(32f, 92f), new Vector2(-32f, 202f));
			m_description = Widgets.Label(((Component)val4).transform, DescriptionHint, 18f, Theme.Text, (TextAlignmentOptions)257);
			m_description.textWrappingMode = (TextWrappingModes)1;
			m_description.overflowMode = (TextOverflowModes)3;
			Widgets.Fill(((Component)m_description).gameObject, 8f);
			m_hint = Widgets.Label(transform, "", 14f, Theme.Muted, (TextAlignmentOptions)514);
			Widgets.Place(((Component)m_hint).gameObject, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(32f, 58f), new Vector2(-32f, 84f));
			Widgets.Place(((Component)Widgets.Box(transform, "FooterLine", Theme.FieldOutline)).gameObject, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(32f, 50f), new Vector2(-32f, 51f));
			Widgets.Place(((Component)LinkButton(transform, LinkIcons.Discord, "COMMENTS/SUGGESTIONS", "https://discord.gg/mnr36G6J4x", iconOnRight: false)).gameObject, new Vector2(0f, 0f), new Vector2(0.5f, 0f), new Vector2(32f, 8f), new Vector2(0f, 42f));
			Widgets.Place(((Component)LinkButton(transform, LinkIcons.PayPal, "DONATIONS", "https://www.paypal.com/donate/?hosted_button_id=BN8HEWHRMAREU", iconOnRight: true)).gameObject, new Vector2(0.5f, 0f), new Vector2(1f, 0f), new Vector2(0f, 8f), new Vector2(-32f, 42f));
		}

		private static Button LinkButton(Transform parent, Sprite icon, string text, string url, bool iconOnRight)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: 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_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_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: 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_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Expected O, but got Unknown
			Image obj = Widgets.Box(parent, text, Color.clear);
			Button val = ((Component)obj).gameObject.AddComponent<Button>();
			Image obj2 = Widgets.Box(((Component)obj).transform, "Logo", Color.white);
			obj2.sprite = icon;
			obj2.preserveAspect = true;
			((Graphic)obj2).raycastTarget = false;
			Vector2 val2 = (iconOnRight ? new Vector2(1f, 0.5f) : new Vector2(0f, 0.5f));
			Widgets.Place(((Component)obj2).gameObject, val2, val2, new Vector2(iconOnRight ? (-30f) : 0f, -15f), new Vector2(iconOnRight ? 0f : 30f, 15f));
			TMP_Text val3 = Widgets.Label(((Component)obj).transform, text, 26f, Color.white, (TextAlignmentOptions)(iconOnRight ? 4100 : 4097));
			if ((Object)(object)GUIManager.Instance.TMP_Norse != (Object)null)
			{
				val3.font = GUIManager.Instance.TMP_Norse;
			}
			Widgets.Place(((Component)val3).gameObject, Vector2.zero, Vector2.one, new Vector2(iconOnRight ? 0f : 42f, 0f), new Vector2(iconOnRight ? (-42f) : 0f, 0f));
			((Selectable)val).targetGraphic = (Graphic)(object)val3;
			((Selectable)val).colors = Theme.Colors(Theme.Text, Theme.AccentBright, Theme.TextBright, Theme.Muted);
			Navigation navigation = default(Navigation);
			((Navigation)(ref navigation)).mode = (Mode)0;
			((Selectable)val).navigation = navigation;
			((UnityEvent)val.onClick).AddListener((UnityAction)delegate
			{
				Application.OpenURL(url);
			});
			return val;
		}

		public void Open()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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)
			if (IsOpen)
			{
				return;
			}
			IsOpen = true;
			((Component)this).gameObject.SetActive(true);
			((Component)this).transform.SetAsLastSibling();
			m_panel.anchoredPosition = m_drag.Clamp(ModSettings.PanelPosition);
			GUIManager.BlockInput(true);
			m_mods = SettingsDiscovery.FindMods();
			foreach (ModInfo mod in m_mods)
			{
				if (!m_savedSaveOnSet.ContainsKey(mod.Config))
				{
					m_savedSaveOnSet[mod.Config] = mod.Config.SaveOnConfigSet;
					mod.Config.SaveOnConfigSet = false;
					mod.Config.SettingChanged += OnSettingChanged;
				}
			}
			BuildTabs();
			Select(m_mods.FirstOrDefault((ModInfo m) => m.Name == s_lastMod) ?? m_mods.FirstOrDefault());
			m_hint.text = "Press " + ((object)ModSettings.ToggleKey.Value/*cast due to .constrained prefix*/).ToString() + " or Esc to close   |   Changes are saved when the panel closes";
		}

		public void Close()
		{
			if (!IsOpen)
			{
				return;
			}
			IsOpen = false;
			m_capturing = null;
			GUIManager.BlockInput(false);
			if (!m_destroying)
			{
				((Component)this).gameObject.SetActive(false);
			}
			foreach (KeyValuePair<ConfigFile, bool> item in m_savedSaveOnSet)
			{
				item.Key.SettingChanged -= OnSettingChanged;
				item.Key.SaveOnConfigSet = item.Value;
				if (m_changedFiles.Contains(item.Key))
				{
					try
					{
						item.Key.Save();
					}
					catch (Exception ex)
					{
						Logger.LogWarning((object)("[ModSettings] Could not save " + item.Key.ConfigFilePath + ": " + ex.Message));
					}
				}
			}
			bool num = m_changedFiles.Count > 0;
			m_savedSaveOnSet.Clear();
			m_changedFiles.Clear();
			if (num)
			{
				SyncWithServer();
			}
		}

		public void Toggle()
		{
			if (IsOpen)
			{
				Close();
			}
			else
			{
				Open();
			}
		}

		private void OnDestroy()
		{
			m_destroying = true;
			Close();
		}

		private void OnSettingChanged(object sender, SettingChangedEventArgs args)
		{
			object obj;
			if (args == null)
			{
				obj = null;
			}
			else
			{
				ConfigEntryBase changedSetting = args.ChangedSetting;
				obj = ((changedSetting != null) ? changedSetting.ConfigFile : null);
			}
			if (obj == null)
			{
				obj = ((sender is ConfigFile) ? sender : null);
			}
			ConfigFile val = (ConfigFile)obj;
			if (val != null)
			{
				m_changedFiles.Add(val);
			}
		}

		private static void SyncWithServer()
		{
			if ((Object)(object)ZNet.instance == (Object)null)
			{
				return;
			}
			string[] array = new string[2] { "InvokeOnConfigurationWindowClosed", "SynchronizeChangedConfig" };
			foreach (string text in array)
			{
				try
				{
					AccessTools.Method(typeof(SynchronizationManager), text, (Type[])null, (Type[])null)?.Invoke(SynchronizationManager.Instance, null);
				}
				catch (Exception ex)
				{
					Logger.LogWarning((object)("[ModSettings] Could not sync settings with the server (" + text + "): " + (ex.InnerException ?? ex).Message));
				}
			}
		}

		private void ResetPosition()
		{
			//IL_0006: 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)
			m_panel.anchoredPosition = Vector2.zero;
			ModSettings.PanelPosition = Vector2.zero;
		}

		private void BuildTabs()
		{
			//IL_006e: 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_008f: 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_00be: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Expected O, but got Unknown
			ClearChildren((Transform)(object)m_tabBar);
			m_tabs.Clear();
			int count = m_mods.Count;
			int num = ((count <= 5) ? 1 : 2);
			int num2 = Math.Max(1, Mathf.CeilToInt((float)count / (float)num));
			m_tabShift = (float)(num - 1) * 39f;
			float num3 = 34f + m_tabShift;
			Widgets.Place(((Component)m_tabBar).gameObject, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(32f, 0f - (74f + num3)), new Vector2(-32f, -74f));
			Widgets.Place(((Component)m_modTitle).gameObject, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(36f, 0f - (154f + m_tabShift)), new Vector2(332f, 0f - (116f + m_tabShift)));
			Widgets.Place(((Component)m_search).gameObject, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(344f, 0f - (154f + m_tabShift)), new Vector2(-32f, 0f - (116f + m_tabShift)));
			for (int i = 0; i < count; i++)
			{
				ModInfo mod = m_mods[i];
				int num4 = i / num2;
				int num5 = i % num2;
				int num6 = ((num4 == num - 1) ? (count - num4 * num2) : num2);
				Button val = Widgets.Button((Transform)(object)m_tabBar, mod.Name, 19f);
				Widgets.Place(((Component)val).gameObject, new Vector2((float)num5 / (float)num6, 1f - (float)(num4 + 1) / (float)num), new Vector2((float)(num5 + 1) / (float)num6, 1f - (float)num4 / (float)num), new Vector2(2.5f, (num4 < num - 1) ? 2.5f : 0f), new Vector2(-2.5f, (num4 > 0) ? (-2.5f) : 0f));
				TMP_Text componentInChildren = ((Component)val).GetComponentInChildren<TMP_Text>(true);
				componentInChildren.enableAutoSizing = true;
				componentInChildren.fontSizeMin = 12f;
				componentInChildren.fontSizeMax = 19f;
				((UnityEvent)val.onClick).AddListener((UnityAction)delegate
				{
					Select(mod);
				});
				m_tabs.Add((val, componentInChildren));
			}
		}

		private void HighlightSelectedTab()
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < m_tabs.Count && i < m_mods.Count; i++)
			{
				bool flag = m_mods[i] == m_selected;
				var (val, val2) = m_tabs[i];
				((Selectable)val).colors = (flag ? Theme.Colors(Theme.Selected, Theme.Selected, Theme.ButtonPressed, Theme.ButtonDisabled) : Theme.Colors(Theme.Button, Theme.ButtonHover, Theme.ButtonPressed, Theme.ButtonDisabled));
				((Graphic)val2).color = (flag ? Theme.TextBright : Theme.Text);
				val2.fontStyle = (FontStyles)(flag ? 1 : 0);
			}
		}

		private void Select(ModInfo mod)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			m_selected = mod;
			m_capturing = null;
			s_lastMod = mod?.Name;
			HighlightSelectedTab();
			m_modTitle.text = ((mod == null) ? "No settings found" : (mod.Name + "  <size=70%><color=" + Theme.Tag(Theme.Muted) + ">v" + mod.Version + "</color></size>"));
			ShowDescription(null);
			ClearChildren((Transform)(object)m_settingsList.content);
			m_rows.Clear();
			m_sections.Clear();
			m_sectionNames.Clear();
			m_shownSection = (m_jumpedTo = null);
			if (mod == null)
			{
				BuildSectionButtons();
				return;
			}
			string text = null;
			List<SettingRow> list = null;
			foreach (SettingInfo setting in mod.Settings)
			{
				if (setting.Section != text)
				{
					text = setting.Section;
					list = new List<SettingRow>();
					m_sections.Add((BuildSectionHeader(text), list));
					m_sectionNames.Add(text);
				}
				SettingRow item = new SettingRow(this, (Transform)(object)m_settingsList.content, setting);
				m_rows.Add(item);
				list.Add(item);
			}
			BuildSectionButtons();
			ApplySearch();
			m_settingsList.verticalNormalizedPosition = 1f;
		}

		private void BuildSectionButtons()
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_00aa: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: 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_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Expected O, but got Unknown
			ClearChildren((Transform)(object)m_sectionBar);
			m_sectionButtons.Clear();
			int count = m_sections.Count;
			int num = ((count != 0) ? ((count <= 7) ? 1 : 2) : 0);
			int num2 = ((num != 0) ? Mathf.CeilToInt((float)count / (float)num) : 0);
			float num3 = (float)num * 32f + (float)Math.Max(0, num - 1) * 5f;
			float num4 = 162f + m_tabShift;
			Widgets.Place(((Component)m_sectionBar).gameObject, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(32f, 0f - (num4 + num3)), new Vector2(-32f, 0f - num4));
			RectTransform val = (RectTransform)((Component)m_settingsList).transform;
			val.offsetMax = new Vector2(val.offsetMax.x, 0f - (num4 + num3 + ((num > 0) ? 10f : 0f)));
			for (int i = 0; i < count; i++)
			{
				int num5 = i / num2;
				int num6 = i % num2;
				int num7 = ((num5 == num - 1) ? (count - num5 * num2) : num2);
				GameObject header = m_sections[i].header;
				Button val2 = Widgets.Button((Transform)(object)m_sectionBar, m_sectionNames[i]);
				Widgets.Place(((Component)val2).gameObject, new Vector2((float)num6 / (float)num7, 1f - (float)(num5 + 1) / (float)num), new Vector2((float)(num6 + 1) / (float)num7, 1f - (float)num5 / (float)num), new Vector2(2.5f, (num5 < num - 1) ? 2.5f : 0f), new Vector2(-2.5f, (num5 > 0) ? (-2.5f) : 0f));
				TMP_Text componentInChildren = ((Component)val2).GetComponentInChildren<TMP_Text>(true);
				componentInChildren.enableAutoSizing = true;
				componentInChildren.fontSizeMin = 11f;
				componentInChildren.fontSizeMax = 16f;
				componentInChildren.textWrappingMode = (TextWrappingModes)0;
				componentInChildren.overflowMode = (TextOverflowModes)1;
				((UnityEvent)val2.onClick).AddListener((UnityAction)delegate
				{
					JumpTo(header);
				});
				m_sectionButtons.Add((val2, componentInChildren, header));
			}
			HighlightSection(null);
		}

		private void JumpTo(GameObject header)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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)
			if (!((Object)(object)header == (Object)null))
			{
				if (!header.activeSelf)
				{
					m_search.text = "";
				}
				RectTransform content = m_settingsList.content;
				LayoutRebuilder.ForceRebuildLayoutImmediate(content);
				Rect rect = content.rect;
				float height = ((Rect)(ref rect)).height;
				rect = m_settingsList.viewport.rect;
				float num = Mathf.Max(0f, height - ((Rect)(ref rect)).height);
				float num2 = Mathf.Clamp(SectionOffset(header) - 2f, 0f, num);
				m_settingsList.StopMovement();
				content.anchoredPosition = new Vector2(content.anchoredPosition.x, num2);
				m_jumpedTo = header;
				m_jumpedOffset = num2;
				HighlightSection(header);
			}
		}

		private static float SectionOffset(GameObject header)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = (RectTransform)header.transform;
			float y = val.anchoredPosition.y;
			Rect rect = val.rect;
			return 0f - (y + ((Rect)(ref rect)).height * (1f - val.pivot.y));
		}

		private GameObject SectionShown()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			float y = m_settingsList.content.anchoredPosition.y;
			if ((Object)(object)m_jumpedTo != (Object)null && Mathf.Abs(y - m_jumpedOffset) < 1f)
			{
				return m_jumpedTo;
			}
			m_jumpedTo = null;
			GameObject val = null;
			f