Decompiled source of N1ktaModManager v3.2.1

BepInEx/plugins/N1ktaModManager.dll

Decompiled 29 minutes ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Collections.Generic;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("N1ktaModManager")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("N1ktaModManager")]
[assembly: AssemblyTitle("N1ktaModManager")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace InGameModManager
{
	[BepInPlugin("com.n1kta.modmanager", "N1kta Mod Manager", "3.2.1")]
	public class ModManagerPlugin : BaseUnityPlugin
	{
		private class BindItem
		{
			public string KeyName;

			public KeyCode CurrentValue;

			public ConfigEntry<KeyCode> LiveEntry;

			public string CfgFilePath;
		}

		private class ModItem
		{
			public string Guid;

			public string FileName;

			public string FullPath;

			public string DisplayName;

			public string Version;

			public bool IsFileEnabled;

			public float CrackAnim;

			public BaseUnityPlugin LoadedInstance;

			public ConfigEntry<bool> LiveToggleConfig;

			public List<BindItem> KeyBinds = new List<BindItem>();
		}

		private ConfigEntry<KeyCode> _toggleKey;

		private ConfigEntry<string> _language;

		private ConfigEntry<bool> _animationsEnabled;

		private ConfigEntry<bool> _passiveAnimEnabled;

		private ConfigEntry<bool> _minimalismMode;

		private ConfigEntry<string> _selectedPcbFile;

		private ConfigEntry<string> _hexDrip;

		private ConfigEntry<string> _hexDisc;

		private ConfigEntry<string> _hexArm;

		private ConfigEntry<string> _hexPcb;

		private ConfigEntry<string> _hexButtons;

		private Color _colDrip = Color.white;

		private Color _colDisc = Color.white;

		private Color _colArm = Color.white;

		private Color _colPcb = Color.white;

		private Color _colButtons = new Color(0.2f, 0.06f, 0.38f, 1f);

		private int _colorTargetTab;

		private bool _colorPanelOpen;

		private float _colorPanelAnim;

		private bool _isOpen;

		private float _openAnim;

		private float _minAnim;

		private bool _restartRequired;

		private int _selectedIndex;

		private float _visualWheelPos;

		private Vector2 _minScrollPos;

		private float _bindsSlideAnim;

		private ModItem _lastBindsMod;

		private BindItem _listeningBind;

		private string _assetsDir;

		private string _pcbBgDir;

		private Texture2D _texDrip;

		private Texture2D _texDisc;

		private Texture2D _texArm;

		private Texture2D _texDefaultPcb;

		private Texture2D _texCustomPcb;

		private Texture2D _texWhite;

		private Texture2D _texSolidBtn;

		private Texture2D _texSolidBtnHover;

		private Texture2D _texSolidRed;

		private Texture2D[] _crackTextures;

		private GUIStyle _solidBtnStyle;

		private GUIStyle _redBtnStyle;

		private GUIStyle _rightHeaderStyle;

		private GUIStyle _discLabelStyle;

		private List<string> _pcbFiles = new List<string>();

		private int _currentPcbIdx = -1;

		private List<ModItem> _mods = new List<ModItem>();

		private bool IsEn => string.Equals(_language.Value, "EN", StringComparison.OrdinalIgnoreCase);

		private string T(string ru, string en)
		{
			if (!IsEn)
			{
				return ru;
			}
			return en;
		}

		private Texture2D MakeSolidTex(Color c)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0011: 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_0019: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(2, 2);
			val.SetPixels((Color[])(object)new Color[4] { c, c, c, c });
			val.Apply();
			return val;
		}

		private void Awake()
		{
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			_toggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "ToggleMenuKey", (KeyCode)289, "Menu toggle key");
			_language = ((BaseUnityPlugin)this).Config.Bind<string>("Appearance", "Language", "RU", "Interface language (RU / EN)");
			_animationsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Appearance", "Animations", true, "Enable UI open/close animations");
			_passiveAnimEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Appearance", "PassiveAnimations", true, "Enable subtle disc/arm/PCB idle motion");
			_minimalismMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Appearance", "MinimalismMode", false, "Switch to clean minimalist UI");
			_selectedPcbFile = ((BaseUnityPlugin)this).Config.Bind<string>("Appearance", "CustomPCB", "", "Custom PCB background filename");
			_hexDrip = ((BaseUnityPlugin)this).Config.Bind<string>("Colors", "DripTint", "FFFFFF", "Drip tint hex");
			_hexDisc = ((BaseUnityPlugin)this).Config.Bind<string>("Colors", "DiscTint", "FFFFFF", "Disc tint hex");
			_hexArm = ((BaseUnityPlugin)this).Config.Bind<string>("Colors", "ArmTint", "FFFFFF", "Arm tint hex");
			_hexPcb = ((BaseUnityPlugin)this).Config.Bind<string>("Colors", "PcbTint", "FFFFFF", "PCB tint hex");
			_hexButtons = ((BaseUnityPlugin)this).Config.Bind<string>("Colors", "ButtonColor", "330F61", "Buttons color hex");
			LoadSavedColors();
			_assetsDir = Path.Combine(Paths.PluginPath, "N1ktaModManager_Assets");
			_pcbBgDir = Path.Combine(_assetsDir, "PCB_Backgrounds");
			Directory.CreateDirectory(_assetsDir);
			Directory.CreateDirectory(_pcbBgDir);
			_texWhite = MakeSolidTex(Color.white);
			RebuildButtonTextures();
			_texDrip = TryLoadPng(Path.Combine(_assetsDir, "drip.png")) ?? _texSolidBtn;
			_texDisc = TryLoadPng(Path.Combine(_assetsDir, "disc.png")) ?? _texWhite;
			_texArm = TryLoadPng(Path.Combine(_assetsDir, "arm.png")) ?? _texWhite;
			_texDefaultPcb = TryLoadPng(Path.Combine(_assetsDir, "pcb.png")) ?? _texSolidBtn;
			_crackTextures = (Texture2D[])(object)new Texture2D[3]
			{
				GenerateCrackTexture(140, 150, 11),
				GenerateCrackTexture(140, 150, 27),
				GenerateCrackTexture(140, 150, 43)
			};
			ReloadPcbList();
			((BaseUnityPlugin)this).Logger.LogInfo((object)$"N1kta Mod Manager v3.2.1 loaded! Press {_toggleKey.Value}.");
		}

		private void Start()
		{
			RefreshModList();
		}

		private void LoadSavedColors()
		{
			//IL_001f: 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_0044: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			Color colDrip = default(Color);
			if (ColorUtility.TryParseHtmlString("#" + _hexDrip.Value, ref colDrip))
			{
				_colDrip = colDrip;
			}
			Color colDisc = default(Color);
			if (ColorUtility.TryParseHtmlString("#" + _hexDisc.Value, ref colDisc))
			{
				_colDisc = colDisc;
			}
			Color colArm = default(Color);
			if (ColorUtility.TryParseHtmlString("#" + _hexArm.Value, ref colArm))
			{
				_colArm = colArm;
			}
			Color colPcb = default(Color);
			if (ColorUtility.TryParseHtmlString("#" + _hexPcb.Value, ref colPcb))
			{
				_colPcb = colPcb;
			}
			Color colButtons = default(Color);
			if (ColorUtility.TryParseHtmlString("#" + _hexButtons.Value, ref colButtons))
			{
				_colButtons = colButtons;
			}
		}

		private void SaveAllColors()
		{
			//IL_0007: 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_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_005f: Unknown result type (might be due to invalid IL or missing references)
			_hexDrip.Value = ColorUtility.ToHtmlStringRGB(_colDrip);
			_hexDisc.Value = ColorUtility.ToHtmlStringRGB(_colDisc);
			_hexArm.Value = ColorUtility.ToHtmlStringRGB(_colArm);
			_hexPcb.Value = ColorUtility.ToHtmlStringRGB(_colPcb);
			_hexButtons.Value = ColorUtility.ToHtmlStringRGB(_colButtons);
			RebuildButtonTextures();
		}

		private void RebuildButtonTextures()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			_colButtons.a = 1f;
			_texSolidBtn = MakeSolidTex(_colButtons);
			Color c = Color.Lerp(_colButtons, Color.white, 0.22f);
			c.a = 1f;
			_texSolidBtnHover = MakeSolidTex(c);
			_texSolidRed = MakeSolidTex(new Color(0.68f, 0.14f, 0.24f, 1f));
			_solidBtnStyle = null;
		}

		private void EnsureStyles()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_006b: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Expected O, but got Unknown
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Expected O, but got Unknown
			if (_solidBtnStyle == null)
			{
				_solidBtnStyle = new GUIStyle(GUI.skin.button);
				_solidBtnStyle.normal.background = _texSolidBtn;
				_solidBtnStyle.hover.background = _texSolidBtnHover;
				_solidBtnStyle.active.background = _texSolidBtnHover;
				_solidBtnStyle.normal.textColor = Color.white;
				_solidBtnStyle.hover.textColor = new Color(1f, 0.88f, 0.25f);
				_solidBtnStyle.fontSize = 11;
				_solidBtnStyle.fontStyle = (FontStyle)1;
				_redBtnStyle = new GUIStyle(_solidBtnStyle);
				_redBtnStyle.normal.background = _texSolidRed;
				_rightHeaderStyle = new GUIStyle(GUI.skin.label);
				_rightHeaderStyle.alignment = (TextAnchor)2;
				_rightHeaderStyle.richText = true;
				_discLabelStyle = new GUIStyle(GUI.skin.label);
				_discLabelStyle.alignment = (TextAnchor)1;
				_discLabelStyle.richText = true;
			}
		}

		private Texture2D TryLoadPng(string path)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			if (!File.Exists(path))
			{
				return null;
			}
			try
			{
				Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false);
				if (ImageConversion.LoadImage(val, File.ReadAllBytes(path)))
				{
					return val;
				}
			}
			catch
			{
			}
			return null;
		}

		private Texture2D GenerateCrackTexture(int w, int h, int seed)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			Texture2D val = new Texture2D(w, h, (TextureFormat)4, false);
			Color32[] cols = (Color32[])(object)new Color32[w * h];
			Color32 crackCore = new Color32((byte)38, (byte)12, (byte)72, (byte)235);
			Color32 crackRim = new Color32(byte.MaxValue, (byte)235, (byte)140, (byte)140);
			Random rng = new Random(seed);
			DrawBolt((float)w * 0.5f + (float)rng.Next(-10, 11), 14f, (float)Math.PI / 2f, (float)h * 0.78f, 1.9f, 2);
			val.SetPixels32(cols);
			val.Apply();
			return val;
			void DrawBolt(float sx, float sy, float angle, float len, float width, int depth)
			{
				//IL_0105: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: 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)
				float num = sx;
				float num2 = sy;
				int num3 = Mathf.Max(4, (int)len);
				for (int i = 0; i < num3; i++)
				{
					angle += (float)(rng.NextDouble() - 0.5) * 0.4f;
					num += Mathf.Cos(angle);
					num2 += Mathf.Sin(angle);
					int num4 = Mathf.RoundToInt(num);
					int num5 = Mathf.RoundToInt(num2);
					float num6 = width * (1f - (float)i / (float)num3 * 0.6f);
					int num7 = Mathf.CeilToInt(num6) + 1;
					for (int j = -num7; j <= num7; j++)
					{
						for (int k = -num7; k <= num7; k++)
						{
							int num8 = num4 + k;
							int num9 = num5 + j;
							if (num8 >= 0 && num8 < w && num9 >= 0 && num9 < h && InsideDiscCircle(num8, num9))
							{
								float num10 = Mathf.Sqrt((float)(k * k + j * j));
								if (num10 <= num6)
								{
									cols[num9 * w + num8] = crackCore;
								}
								else if (num10 <= num6 + 1.1f && cols[num9 * w + num8].a == 0)
								{
									cols[num9 * w + num8] = crackRim;
								}
							}
						}
					}
					if (depth > 0 && i > 8 && i % 15 == 0 && rng.NextDouble() < 0.75)
					{
						float angle2 = angle + ((rng.Next(0, 2) == 0) ? 0.52f : (-0.52f));
						DrawBolt(num, num2, angle2, len * 0.5f, width * 0.65f, depth - 1);
					}
				}
			}
			bool InsideDiscCircle(int px, int py)
			{
				float num = (float)px - (float)w * 0.5f;
				float num2 = 84f + (float)(h - 1 - py);
				return num * num + num2 * num2 <= 53824f;
			}
		}

		private void ReloadPcbList()
		{
			string[] exts = new string[3] { ".png", ".jpg", ".jpeg" };
			_pcbFiles = (Directory.Exists(_pcbBgDir) ? (from f in Directory.GetFiles(_pcbBgDir)
				where exts.Contains(Path.GetExtension(f).ToLowerInvariant())
				orderby f
				select f).ToList() : new List<string>());
			int num = _pcbFiles.FindIndex((string f) => string.Equals(Path.GetFileName(f), _selectedPcbFile.Value, StringComparison.OrdinalIgnoreCase));
			if (num >= 0)
			{
				_currentPcbIdx = num;
				_texCustomPcb = TryLoadPng(_pcbFiles[num]);
			}
			else
			{
				_currentPcbIdx = -1;
				_texCustomPcb = null;
			}
		}

		private void CyclePcbBackground()
		{
			ReloadPcbList();
			if (_pcbFiles.Count != 0)
			{
				_currentPcbIdx++;
				if (_currentPcbIdx >= _pcbFiles.Count)
				{
					_currentPcbIdx = -1;
					_selectedPcbFile.Value = "";
					_texCustomPcb = null;
				}
				else
				{
					_selectedPcbFile.Value = Path.GetFileName(_pcbFiles[_currentPcbIdx]);
					_texCustomPcb = TryLoadPng(_pcbFiles[_currentPcbIdx]);
				}
			}
		}

		private void Update()
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_0039: 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_0046: Invalid comparison between Unknown and I4
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			if (_listeningBind != null)
			{
				if (!Input.anyKeyDown)
				{
					return;
				}
				{
					foreach (KeyCode value2 in Enum.GetValues(typeof(KeyCode)))
					{
						if ((int)value2 != 0 && Input.GetKeyDown(value2))
						{
							if ((int)value2 != 27)
							{
								ApplyKeyBindChange(_listeningBind, value2);
							}
							_listeningBind = null;
							break;
						}
					}
					return;
				}
			}
			if (Input.GetKeyDown(_toggleKey.Value))
			{
				_isOpen = !_isOpen;
				if (_isOpen)
				{
					RefreshModList();
					Cursor.visible = true;
					Cursor.lockState = (CursorLockMode)0;
				}
			}
			bool value = _animationsEnabled.Value;
			float num = ((_isOpen && !_minimalismMode.Value) ? 1f : 0f);
			_openAnim = ((!value) ? num : Mathf.MoveTowards(_openAnim, num, Time.unscaledDeltaTime * 1.9f));
			float num2 = ((_isOpen && _minimalismMode.Value) ? 1f : 0f);
			_minAnim = ((!value) ? num2 : Mathf.MoveTowards(_minAnim, num2, Time.unscaledDeltaTime * 2.8f));
			float num3 = ((_isOpen && !_minimalismMode.Value && _colorPanelOpen && _openAnim > 0.75f) ? 1f : 0f);
			_colorPanelAnim = ((!value) ? num3 : Mathf.MoveTowards(_colorPanelAnim, num3, Time.unscaledDeltaTime * 4.5f));
			_visualWheelPos = ((!value) ? ((float)_selectedIndex) : Mathf.Lerp(_visualWheelPos, (float)_selectedIndex, Time.unscaledDeltaTime * 9.5f));
			for (int i = 0; i < _mods.Count; i++)
			{
				float num4 = ((_mods[i].IsFileEnabled && _openAnim > 0.25f) ? 1f : 0f);
				_mods[i].CrackAnim = ((!value) ? num4 : Mathf.MoveTowards(_mods[i].CrackAnim, num4, Time.unscaledDeltaTime * 7.2f));
			}
			ModItem modItem = ((_mods.Count > 0) ? _mods[(_selectedIndex % _mods.Count + _mods.Count) % _mods.Count] : null);
			bool flag = modItem != null && modItem.KeyBinds.Count > 0;
			if (flag)
			{
				_lastBindsMod = modItem;
			}
			float num5 = ((_isOpen && !_minimalismMode.Value && _openAnim > 0.78f && flag) ? 1f : 0f);
			_bindsSlideAnim = ((!value) ? num5 : Mathf.MoveTowards(_bindsSlideAnim, num5, Time.unscaledDeltaTime * 3.4f));
			if (_bindsSlideAnim <= 0.001f && !flag)
			{
				_lastBindsMod = null;
			}
		}

		private void ApplyKeyBindChange(BindItem bind, KeyCode newKey)
		{
			//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_0015: 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)
			bind.CurrentValue = newKey;
			if (bind.LiveEntry != null)
			{
				bind.LiveEntry.Value = newKey;
			}
			else
			{
				if (string.IsNullOrEmpty(bind.CfgFilePath) || !File.Exists(bind.CfgFilePath))
				{
					return;
				}
				try
				{
					string[] array = File.ReadAllLines(bind.CfgFilePath);
					for (int i = 0; i < array.Length; i++)
					{
						string text = array[i].Trim();
						if (text.StartsWith(bind.KeyName + " ", StringComparison.OrdinalIgnoreCase) || text.StartsWith(bind.KeyName + "=", StringComparison.OrdinalIgnoreCase))
						{
							array[i] = $"{bind.KeyName} = {newKey}";
							break;
						}
					}
					File.WriteAllLines(bind.CfgFilePath, array);
				}
				catch (Exception ex)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)("Offline cfg write error: " + ex.Message));
				}
			}
		}

		private bool TryGetPluginMetadata(string filePath, out string guid, out string name, out string ver)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			guid = (name = (ver = null));
			try
			{
				AssemblyDefinition val = AssemblyDefinition.ReadAssembly(filePath);
				try
				{
					Enumerator<TypeDefinition> enumerator = val.MainModule.Types.GetEnumerator();
					try
					{
						while (enumerator.MoveNext())
						{
							Enumerator<CustomAttribute> enumerator2 = enumerator.Current.CustomAttributes.GetEnumerator();
							try
							{
								while (enumerator2.MoveNext())
								{
									CustomAttribute current = enumerator2.Current;
									if (((MemberReference)current.AttributeType).FullName == "BepInEx.BepInPlugin" && current.ConstructorArguments.Count >= 3)
									{
										CustomAttributeArgument val2 = ((IEnumerable<CustomAttributeArgument>)current.ConstructorArguments).ElementAt(0);
										guid = ((CustomAttributeArgument)(ref val2)).Value?.ToString();
										val2 = ((IEnumerable<CustomAttributeArgument>)current.ConstructorArguments).ElementAt(1);
										name = ((CustomAttributeArgument)(ref val2)).Value?.ToString();
										val2 = ((IEnumerable<CustomAttributeArgument>)current.ConstructorArguments).ElementAt(2);
										ver = ((CustomAttributeArgument)(ref val2)).Value?.ToString();
										return true;
									}
								}
							}
							finally
							{
								((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose();
							}
						}
					}
					finally
					{
						((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
					}
				}
				finally
				{
					((IDisposable)val)?.Dispose();
				}
			}
			catch
			{
			}
			return false;
		}

		private List<BindItem> ParseOfflineCfgBinds(string guid)
		{
			//IL_00e3: 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)
			List<BindItem> list = new List<BindItem>();
			if (string.IsNullOrEmpty(guid))
			{
				return list;
			}
			string text = Path.Combine(Paths.ConfigPath, guid + ".cfg");
			if (!File.Exists(text))
			{
				return list;
			}
			try
			{
				string[] array = File.ReadAllLines(text);
				bool flag = false;
				string[] array2 = array;
				for (int i = 0; i < array2.Length; i++)
				{
					string text2 = array2[i].Trim();
					if (text2.StartsWith("# Setting type: KeyCode", StringComparison.OrdinalIgnoreCase))
					{
						flag = true;
					}
					else
					{
						if (text2.StartsWith("#") || text2.StartsWith("[") || string.IsNullOrEmpty(text2))
						{
							continue;
						}
						if (flag && text2.Contains("="))
						{
							flag = false;
							int num = text2.IndexOf('=');
							string keyName = text2.Substring(0, num).Trim();
							if (Enum.TryParse<KeyCode>(text2.Substring(num + 1).Trim(), ignoreCase: true, out KeyCode result))
							{
								list.Add(new BindItem
								{
									KeyName = keyName,
									CurrentValue = result,
									CfgFilePath = text
								});
							}
						}
						else
						{
							flag = false;
						}
					}
				}
			}
			catch
			{
			}
			return list;
		}

		private void RefreshModList()
		{
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<string, float> dictionary = _mods.ToDictionary((ModItem m) => m.Guid ?? m.FileName, (ModItem m) => m.CrackAnim);
			_mods.Clear();
			if (!Directory.Exists(Paths.PluginPath))
			{
				return;
			}
			List<PluginInfo> source = Chainloader.PluginInfos.Values.ToList();
			foreach (string item in from f in Directory.GetFiles(Paths.PluginPath, "*.*", SearchOption.AllDirectories)
				where f.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".dll.disabled", StringComparison.OrdinalIgnoreCase)
				select f)
			{
				string fileName = Path.GetFileName(item);
				if (fileName.StartsWith("N1ktaModManager", StringComparison.OrdinalIgnoreCase) || fileName.StartsWith("InGameModManager", StringComparison.OrdinalIgnoreCase))
				{
					continue;
				}
				bool flag = item.EndsWith(".dll", StringComparison.OrdinalIgnoreCase);
				string cleanPath = (flag ? item : item.Substring(0, item.Length - ".disabled".Length));
				PluginInfo val = ((IEnumerable<PluginInfo>)source).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo p) => string.Equals(p.Location, cleanPath, StringComparison.OrdinalIgnoreCase)));
				string guid;
				string name;
				string ver;
				if (val != null)
				{
					guid = val.Metadata.GUID;
					name = val.Metadata.Name;
					ver = val.Metadata.Version.ToString();
				}
				else if (!TryGetPluginMetadata(item, out guid, out name, out ver))
				{
					continue;
				}
				dictionary.TryGetValue(guid ?? fileName, out var value);
				if (!dictionary.ContainsKey(guid ?? fileName))
				{
					value = (flag ? 1f : 0f);
				}
				ModItem modItem = new ModItem
				{
					Guid = guid,
					FileName = fileName,
					FullPath = item,
					IsFileEnabled = flag,
					CrackAnim = value,
					DisplayName = name,
					Version = ver,
					LoadedInstance = ((val != null) ? val.Instance : null)
				};
				BaseUnityPlugin loadedInstance = modItem.LoadedInstance;
				if (((loadedInstance != null) ? loadedInstance.Config : null) != null)
				{
					foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item2 in modItem.LoadedInstance.Config)
					{
						if (item2.Key.Key.Equals("Enabled", StringComparison.OrdinalIgnoreCase) && item2.Value is ConfigEntry<bool> liveToggleConfig)
						{
							modItem.LiveToggleConfig = liveToggleConfig;
						}
						else if (item2.Value is ConfigEntry<KeyCode> val2)
						{
							modItem.KeyBinds.Add(new BindItem
							{
								KeyName = ((ConfigEntryBase)val2).Definition.Key,
								CurrentValue = val2.Value,
								LiveEntry = val2
							});
						}
					}
				}
				else
				{
					modItem.KeyBinds = ParseOfflineCfgBinds(guid);
				}
				_mods.Add(modItem);
			}
			if (_mods.Count == 0)
			{
				_selectedIndex = 0;
			}
			else
			{
				_selectedIndex = (_selectedIndex % _mods.Count + _mods.Count) % _mods.Count;
			}
			_visualWheelPos = _selectedIndex;
		}

		private void ToggleModFile(ModItem mod)
		{
			if (mod == null)
			{
				return;
			}
			try
			{
				string text = (mod.IsFileEnabled ? (mod.FullPath + ".disabled") : mod.FullPath.Substring(0, mod.FullPath.Length - ".disabled".Length));
				File.Move(mod.FullPath, text);
				mod.IsFileEnabled = !mod.IsFileEnabled;
				mod.FullPath = text;
				mod.FileName = Path.GetFileName(text);
				_restartRequired = true;
				if (mod.LiveToggleConfig != null)
				{
					mod.LiveToggleConfig.Value = mod.IsFileEnabled;
				}
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Toggle error: " + ex.Message));
			}
		}

		private void StepDisc(int dir)
		{
			if (_mods.Count != 0)
			{
				_selectedIndex += dir;
				_listeningBind = null;
			}
		}

		private void OnGUI()
		{
			if (!(_openAnim <= 0.001f) || !(_minAnim <= 0.001f))
			{
				EnsureStyles();
				if (_minAnim > 0.001f)
				{
					DrawMinimalistUI();
				}
				if (_openAnim > 0.001f)
				{
					DrawMaximalistUI();
				}
			}
		}

		private void DrawMaximalistUI()
		{
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0722: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0734: Unknown result type (might be due to invalid IL or missing references)
			//IL_073e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0752: Unknown result type (might be due to invalid IL or missing references)
			//IL_0762: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: 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_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0508: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(_openAnim / 0.34f));
			float num2 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((_openAnim - 0.16f) / 0.46f));
			float num3 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((_openAnim - 0.36f) / 0.4f));
			float num4 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((_openAnim - 0.5f) / 0.36f));
			float num5 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((_openAnim - 0.64f) / 0.36f));
			float num6 = Screen.width;
			ModItem modItem = ((_mods.Count > 0) ? _mods[(_selectedIndex % _mods.Count + _mods.Count) % _mods.Count] : null);
			int num7;
			float num8;
			if (_passiveAnimEnabled.Value && _isOpen)
			{
				num7 = ((!_minimalismMode.Value) ? 1 : 0);
				if (num7 != 0)
				{
					num8 = Mathf.Sin(Time.unscaledTime * 7.5f) * 0.4f + Mathf.Sin(Time.unscaledTime * 19f) * 0.15f;
					goto IL_016b;
				}
			}
			else
			{
				num7 = 0;
			}
			num8 = 0f;
			goto IL_016b;
			IL_016b:
			float num9 = num8;
			float num10 = ((num7 != 0) ? (Mathf.Sin(Time.unscaledTime * 4.5f + 0.7f) * 0.22f + Mathf.Sin(Time.unscaledTime * 12f) * 0.08f) : 0f);
			float num11 = ((num7 != 0) ? (Mathf.Sin(Time.unscaledTime * 2.2f) * 2.2f) : 0f);
			float num12 = ((num7 != 0) ? (0.95f + 0.05f * Mathf.Sin(Time.unscaledTime * 3.1f)) : 1f);
			float num13 = 490f;
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(num6 - 255f, Mathf.Lerp(-260f, 22f, num2));
			float num14 = 290f;
			float num15 = 525f;
			float num16 = Mathf.Lerp(num6 + 10f, num6 - num14, num3);
			float num17 = num11;
			ModItem modItem2 = ((modItem != null && modItem.KeyBinds.Count > 0) ? modItem : _lastBindsMod);
			if (_bindsSlideAnim > 0.01f && modItem2 != null && modItem2.KeyBinds.Count > 0)
			{
				DrawHorizontalBindsDrawer(num16, modItem2);
			}
			if (num5 > 0.01f)
			{
				DrawPlayerWindow(val, num16, num5, modItem);
			}
			if (_colorPanelAnim > 0.01f)
			{
				DrawColorCustomizerPanel();
			}
			if (num3 > 0.01f)
			{
				Texture2D val2 = (((Object)(object)_texCustomPcb != (Object)null) ? _texCustomPcb : _texDefaultPcb);
				GUI.color = new Color(_colPcb.r * num12, _colPcb.g * num12, _colPcb.b * num12, 1f);
				GUI.DrawTexture(new Rect(num16, num17, num14, num15), (Texture)(object)val2);
				GUI.color = Color.white;
				if (num3 > 0.85f)
				{
					DrawEmbeddedBoardSettings(num16, num17, num14, num15);
				}
			}
			if (num2 > 0.01f)
			{
				float num18 = (0f - _visualWheelPos) * 60f + (1f - num2) * 180f + num9;
				Matrix4x4 matrix = GUI.matrix;
				GUIUtility.RotateAroundPivot(num18, val);
				GUI.color = _colDisc;
				GUI.DrawTexture(new Rect(val.x - num13 * 0.5f, val.y - num13 * 0.5f, num13, num13), (Texture)(object)_texDisc);
				GUI.color = Color.white;
				if (_mods.Count > 0)
				{
					int num19 = Mathf.RoundToInt(_visualWheelPos);
					Rect val4 = default(Rect);
					for (int i = -3; i <= 2; i++)
					{
						int num20 = num19 + i;
						int num21 = (num20 % _mods.Count + _mods.Count) % _mods.Count;
						ModItem modItem3 = _mods[num21];
						float num22 = (float)num20 * 60f + 90f;
						Matrix4x4 matrix2 = GUI.matrix;
						GUIUtility.RotateAroundPivot(num22 - 90f, val);
						if (modItem3.CrackAnim > 0.01f && _crackTextures != null && _crackTextures.Length != 0)
						{
							float num23 = Mathf.SmoothStep(0f, 1f, modItem3.CrackAnim);
							Texture2D val3 = _crackTextures[num21 % _crackTextures.Length];
							float num24 = 140f;
							float num25 = 150f;
							float num26 = val.x - num24 * 0.5f;
							float num27 = val.y + 84f + num25;
							float num28 = num25 * num23;
							GUI.color = new Color(1f, 1f, 1f, Mathf.Clamp01(num23 * 1.4f));
							GUI.BeginGroup(new Rect(num26, num27 - num28, num24, num28));
							GUI.DrawTexture(new Rect(0f, num28 - num25, num24, num25), (Texture)(object)val3);
							GUI.EndGroup();
							GUI.color = Color.white;
						}
						bool num29 = num21 == (_selectedIndex % _mods.Count + _mods.Count) % _mods.Count;
						((Rect)(ref val4))..ctor(val.x - 84f, val.y + 132f, 168f, 44f);
						string text = ((modItem3.DisplayName.Length > 18) ? (modItem3.DisplayName.Substring(0, 17) + "…") : modItem3.DisplayName);
						string text2 = (num29 ? "#5818A8" : (modItem3.IsFileEnabled ? "#1A0B2E" : "#4A3D5C"));
						GUI.Label(new Rect(((Rect)(ref val4)).x + 1f, ((Rect)(ref val4)).y + 1f, ((Rect)(ref val4)).width, ((Rect)(ref val4)).height), "<size=11><color=#FFE57F><b>" + text + "</b></color></size>\n<size=9><color=#FFE57F>v" + modItem3.Version + "</color></size>", _discLabelStyle);
						GUI.Label(val4, "<size=11><color=" + text2 + "><b>" + text + "</b></color></size>\n<size=9><color=" + text2 + "><b>v" + modItem3.Version + "</b></color></size>", _discLabelStyle);
						GUI.matrix = matrix2;
					}
				}
				GUI.matrix = matrix;
				if (num4 > 0.01f)
				{
					Matrix4x4 matrix3 = GUI.matrix;
					float num30 = 315f;
					float num31 = 97f;
					float num32 = Mathf.Lerp(num6 + num30 + 25f, num6 + 52f, num4);
					Vector2 val5 = default(Vector2);
					((Vector2)(ref val5))..ctor(num32, 185f);
					GUIUtility.RotateAroundPivot(Mathf.Lerp(-38f, -16f, num4) + num10, val5);
					GUI.color = _colArm;
					GUI.DrawTexture(new Rect(val5.x - num30, val5.y - num31 * 0.5f, num30, num31), (Texture)(object)_texArm);
					GUI.color = Color.white;
					GUI.matrix = matrix3;
				}
			}
			if (num > 0.01f)
			{
				float num33 = 511f;
				float num34 = 156f;
				float num35 = Mathf.Lerp(0f - num34, -4f, num);
				GUI.color = _colDrip;
				GUI.DrawTexture(new Rect(num6 - num33, num35, num33, num34), (Texture)(object)_texDrip);
				GUI.color = Color.white;
				GUI.Label(new Rect(num6 - 230f, num35 + 8f, 218f, 24f), "<color=#FFD94A><size=13><b>N1kta Mod Manager</b></size></color>", _rightHeaderStyle);
			}
		}

		private void DrawPlayerWindow(Vector2 discCenter, float pcbX, float tWin, ModItem activeMod)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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_007d: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			float num = 246f;
			float num2 = 102f * tWin;
			float num3 = pcbX - num - 12f;
			float num4 = discCenter.y + 230f;
			GUI.color = new Color(0.16f, 0.08f, 0.28f, 0.98f);
			GUI.DrawTexture(new Rect(num3, num4, num, num2), (Texture)(object)_texWhite);
			GUI.color = new Color(0.95f, 0.75f, 0.2f, 1f);
			GUI.DrawTexture(new Rect(num3, num4, num, 20f), (Texture)(object)_texWhite);
			GUI.color = Color.white;
			if (!(tWin <= 0.8f))
			{
				string text = ((activeMod != null) ? activeMod.DisplayName : T("Нет модов", "No mods"));
				GUI.Label(new Rect(num3 + 8f, num4 + 1f, num - 16f, 20f), "<color=#1A0B2E><size=11><b>" + text + "</b></size></color>");
				if (GUI.Button(new Rect(num3 + 10f, num4 + 27f, 66f, 36f), "<b>◀◀</b>", _solidBtnStyle))
				{
					StepDisc(-1);
				}
				bool flag = activeMod?.IsFileEnabled ?? false;
				GUI.backgroundColor = (Color)(flag ? new Color(0.95f, 0.75f, 0.15f, 1f) : Color.white);
				string text2 = ((!IsEn) ? (flag ? "<b>■ ВКЛ</b>" : "<b>▶ ВЫКЛ</b>") : (flag ? "<b>■ ON</b>" : "<b>▶ OFF</b>"));
				if (GUI.Button(new Rect(num3 + 83f, num4 + 27f, 80f, 36f), text2, _solidBtnStyle) && activeMod != null)
				{
					ToggleModFile(activeMod);
				}
				GUI.backgroundColor = Color.white;
				if (GUI.Button(new Rect(num3 + 170f, num4 + 27f, 66f, 36f), "<b>▶▶</b>", _solidBtnStyle))
				{
					StepDisc(1);
				}
				string text3 = (_restartRequired ? T("⚠ Перезапусти игру для .dll", "⚠ Restart game for .dll") : ((activeMod == null) ? "" : ((activeMod.LiveToggleConfig != null) ? T("Статус: Live-переключение", "Status: Live toggle") : T("Статус: Файл .dll / .disabled", "Status: .dll / .disabled file"))));
				GUI.Label(new Rect(num3 + 10f, num4 + 70f, num - 20f, 22f), "<size=10><color=#FFD94A>" + text3 + "</color></size>");
			}
		}

		private void DrawHorizontalBindsDrawer(float pcbX, ModItem mod)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: 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_0224: Unknown result type (might be due to invalid IL or missing references)
			int count = mod.KeyBinds.Count;
			float num = 246f;
			float num2 = 34f + (float)count * 30f;
			float num3 = Mathf.SmoothStep(0f, 1f, _bindsSlideAnim);
			float num4 = pcbX - num - 12f;
			float num5 = Mathf.Lerp(pcbX + 16f, num4, num3);
			float num6 = 362f;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(num5, num6, num, num2);
			GUI.color = new Color(0.18f, 0.06f, 0.34f, 0.98f);
			GUI.DrawTexture(val, (Texture)(object)_texWhite);
			GUI.color = new Color(0.95f, 0.75f, 0.15f, 1f);
			GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, 4f), (Texture)(object)_texWhite);
			GUI.color = Color.white;
			GUI.Label(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y + 6f, ((Rect)(ref val)).width - 20f, 22f), "<size=11><color=#FFD94A><b>" + T("Бинды мода:", "Mod Keybinds:") + "</b></color></size>");
			for (int i = 0; i < count; i++)
			{
				BindItem bindItem = mod.KeyBinds[i];
				float num7 = ((Rect)(ref val)).y + 28f + (float)i * 30f;
				GUI.Label(new Rect(((Rect)(ref val)).x + 10f, num7 + 3f, 130f, 22f), "<size=10>" + bindItem.KeyName + "</size>");
				bool flag = _listeningBind == bindItem;
				string text = (flag ? T("Жми...", "Key...") : $"[{bindItem.CurrentValue}]");
				GUI.backgroundColor = (Color)(flag ? new Color(1f, 0.8f, 0.1f, 1f) : Color.white);
				if (GUI.Button(new Rect(((Rect)(ref val)).x + 142f, num7, 94f, 24f), "<size=10><b>" + text + "</b></size>", _solidBtnStyle))
				{
					_listeningBind = (flag ? null : bindItem);
				}
			}
			GUI.backgroundColor = Color.white;
		}

		private void DrawEmbeddedBoardSettings(float pcbX, float pcbY, float pcbW, float pcbH)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			float num = pcbX + pcbW - 12f;
			float num2 = pcbY + 280f;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(pcbX + 30f, num2, num - (pcbX + 30f), 20f);
			GUI.color = new Color(0.12f, 0.03f, 0.24f, 1f);
			GUI.DrawTexture(val, (Texture)(object)_texWhite);
			GUI.color = Color.white;
			GUI.Label(new Rect(((Rect)(ref val)).x + 6f, ((Rect)(ref val)).y + 1f, ((Rect)(ref val)).width - 8f, 20f), "<color=#FFD94A><size=10><b>" + T("НАСТРОЙКИ МЕНЕДЖЕРА", "MANAGER SETTINGS") + "</b></size></color>");
			float num3 = pcbX + 32f;
			if (GUI.Button(new Rect(num3, num2 + 23f, num - num3, 24f), T("Язык: Русский (RU)", "Language: English (EN)"), _solidBtnStyle))
			{
				_language.Value = (IsEn ? "RU" : "EN");
			}
			float num4 = pcbX + 42f;
			string text = ((_pcbFiles.Count == 0) ? T("Фон платы: Стандарт", "PCB BG: Default") : ((_currentPcbIdx < 0) ? T($"Фон платы: Стандарт ({_pcbFiles.Count})", $"PCB BG: Default ({_pcbFiles.Count})") : T($"Фон платы: {_currentPcbIdx + 1}/{_pcbFiles.Count}", $"PCB BG: {_currentPcbIdx + 1}/{_pcbFiles.Count}")));
			if (GUI.Button(new Rect(num4, num2 + 50f, num - num4, 24f), text, _solidBtnStyle))
			{
				CyclePcbBackground();
			}
			float num5 = pcbX + 52f;
			float num6 = (num - num5 - 4f) * 0.5f;
			if (GUI.Button(new Rect(num5, num2 + 77f, num6, 24f), T("Минимализм", "Minimalism"), _solidBtnStyle))
			{
				_minimalismMode.Value = true;
			}
			if (GUI.Button(new Rect(num5 + num6 + 4f, num2 + 77f, num6, 24f), _colorPanelOpen ? T("Цвета: СКРЫТЬ", "Colors: HIDE") : T("Цвета: ОТКР.", "Colors: OPEN"), _solidBtnStyle))
			{
				_colorPanelOpen = !_colorPanelOpen;
			}
			float num7 = pcbX + 64f;
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor(num7, num2 + 104f, num - num7, 20f);
			GUI.color = new Color(0.12f, 0.03f, 0.24f, 1f);
			GUI.DrawTexture(val2, (Texture)(object)_texWhite);
			GUI.color = Color.white;
			_animationsEnabled.Value = GUI.Toggle(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 1f, ((Rect)(ref val2)).width - 4f, 18f), _animationsEnabled.Value, T(" Анимации UI", " UI Animations"));
			float num8 = pcbX + 74f;
			Rect val3 = default(Rect);
			((Rect)(ref val3))..ctor(num8, num2 + 126f, num - num8, 20f);
			GUI.color = new Color(0.12f, 0.03f, 0.24f, 1f);
			GUI.DrawTexture(val3, (Texture)(object)_texWhite);
			GUI.color = Color.white;
			_passiveAnimEnabled.Value = GUI.Toggle(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 1f, ((Rect)(ref val3)).width - 4f, 18f), _passiveAnimEnabled.Value, T(" Пассивные анимки", " Passive Anims"));
			float num9 = pcbX + 86f;
			float num10 = (num - num9 - 4f) * 0.5f;
			if (GUI.Button(new Rect(num9, num2 + 150f, num10, 26f), T("Обновить", "Refresh"), _solidBtnStyle))
			{
				RefreshModList();
			}
			if (GUI.Button(new Rect(num9 + num10 + 4f, num2 + 150f, num10, 26f), T("Закрыть [F8]", "Close [F8]"), _redBtnStyle))
			{
				_isOpen = false;
			}
		}

		private void DrawColorCustomizerPanel()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: 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_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: 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_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			float num = 310f;
			float num2 = 168f;
			float num3 = Mathf.SmoothStep(0f, 1f, _colorPanelAnim);
			float num4 = (float)Screen.width + 15f;
			float num5 = (float)Screen.width - num - 12f;
			float num6 = Mathf.Lerp(num4, num5, num3);
			float num7 = 535f;
			GUI.color = new Color(0.14f, 0.05f, 0.26f, 0.98f);
			GUI.DrawTexture(new Rect(num6, num7, num, num2), (Texture)(object)_texWhite);
			GUI.color = new Color(0.95f, 0.75f, 0.2f, 1f);
			GUI.DrawTexture(new Rect(num6, num7, num, 20f), (Texture)(object)_texWhite);
			GUI.color = Color.white;
			GUI.Label(new Rect(num6 + 8f, num7 + 1f, num - 16f, 20f), "<color=#1A0B2E><size=11><b>" + T("НАСТРОЙКА ЦВЕТОВ ТЕКСТУР И КНОПОК", "CUSTOMIZE TEXTURE & BUTTON COLORS") + "</b></size></color>");
			string[] array = ((!IsEn) ? new string[5] { "Подтёк", "Диск", "Тонарм", "Плата", "Кнопки" } : new string[5] { "Drip", "Disc", "Arm", "PCB", "Btns" });
			float num8 = (num - 24f) / 5f;
			for (int i = 0; i < 5; i++)
			{
				GUI.backgroundColor = (Color)((_colorTargetTab == i) ? new Color(0.95f, 0.75f, 0.15f, 1f) : Color.white);
				if (GUI.Button(new Rect(num6 + 8f + (float)i * (num8 + 2f), num7 + 25f, num8, 24f), array[i], _solidBtnStyle))
				{
					_colorTargetTab = i;
				}
			}
			GUI.backgroundColor = Color.white;
			Color val = ((_colorTargetTab == 0) ? _colDrip : ((_colorTargetTab == 1) ? _colDisc : ((_colorTargetTab == 2) ? _colArm : ((_colorTargetTab == 3) ? _colPcb : _colButtons))));
			float num9 = GUI.HorizontalSlider(new Rect(num6 + 42f, num7 + 58f, num - 54f, 16f), val.r, 0f, 1f);
			float num10 = GUI.HorizontalSlider(new Rect(num6 + 42f, num7 + 80f, num - 54f, 16f), val.g, 0f, 1f);
			float num11 = GUI.HorizontalSlider(new Rect(num6 + 42f, num7 + 102f, num - 54f, 16f), val.b, 0f, 1f);
			GUI.Label(new Rect(num6 + 10f, num7 + 54f, 30f, 20f), "<color=#FF6666><b>R:</b></color>");
			GUI.Label(new Rect(num6 + 10f, num7 + 76f, 30f, 20f), "<color=#66FF66><b>G:</b></color>");
			GUI.Label(new Rect(num6 + 10f, num7 + 98f, 30f, 20f), "<color=#66AAFF><b>B:</b></color>");
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(num9, num10, num11, 1f);
			if (val2 != val)
			{
				if (_colorTargetTab == 0)
				{
					_colDrip = val2;
				}
				else if (_colorTargetTab == 1)
				{
					_colDisc = val2;
				}
				else if (_colorTargetTab == 2)
				{
					_colArm = val2;
				}
				else if (_colorTargetTab == 3)
				{
					_colPcb = val2;
				}
				else
				{
					_colButtons = val2;
				}
				SaveAllColors();
			}
			if (GUI.Button(new Rect(num6 + 10f, num7 + 130f, 140f, 26f), T("Сбросить цвета", "Reset Colors"), _solidBtnStyle))
			{
				_colDrip = (_colDisc = (_colArm = (_colPcb = Color.white)));
				_colButtons = new Color(0.2f, 0.06f, 0.38f, 1f);
				SaveAllColors();
			}
			if (GUI.Button(new Rect(num6 + 160f, num7 + 130f, 140f, 26f), T("Готово", "Done"), _solidBtnStyle))
			{
				_colorPanelOpen = false;
			}
		}

		private void DrawMinimalistUI()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: 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_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			float num = 360f;
			float num2 = 420f;
			float num3 = Mathf.SmoothStep(0f, 1f, _minAnim);
			float num4 = Mathf.Lerp((float)Screen.width + 15f, (float)Screen.width - num - 16f, num3);
			float num5 = 16f;
			GUI.color = new Color(0.08f, 0.09f, 0.11f, 0.96f);
			GUI.DrawTexture(new Rect(num4, num5, num, num2), (Texture)(object)_texWhite);
			GUI.color = new Color(0.25f, 0.27f, 0.32f, 1f);
			GUI.DrawTexture(new Rect(num4, num5, num, 26f), (Texture)(object)_texWhite);
			GUI.color = Color.white;
			GUI.Label(new Rect(num4 + 10f, num5 + 4f, 210f, 20f), "<b>N1kta Mod Manager (Minimal)</b>");
			if (GUI.Button(new Rect(num4 + num - 135f, num5 + 3f, 128f, 20f), T("Максимализм", "Maximalism"), _solidBtnStyle))
			{
				_minimalismMode.Value = false;
			}
			GUILayout.BeginArea(new Rect(num4 + 10f, num5 + 32f, num - 20f, num2 - 76f));
			_minScrollPos = GUILayout.BeginScrollView(_minScrollPos, Array.Empty<GUILayoutOption>());
			foreach (ModItem mod in _mods)
			{
				GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), Array.Empty<GUILayoutOption>());
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("<b>" + mod.DisplayName + "</b> <size=10>v" + mod.Version + "</size>", Array.Empty<GUILayoutOption>());
				string obj = (mod.IsFileEnabled ? T("ВКЛ", "ON") : T("ВЫКЛ", "OFF"));
				GUI.backgroundColor = (mod.IsFileEnabled ? new Color(0.2f, 0.75f, 0.35f) : new Color(0.45f, 0.45f, 0.48f));
				if (GUILayout.Button(obj, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(65f),
					GUILayout.Height(22f)
				}))
				{
					ToggleModFile(mod);
				}
				GUI.backgroundColor = Color.white;
				GUILayout.EndHorizontal();
				foreach (BindItem keyBind in mod.KeyBinds)
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label("  <size=10>" + keyBind.KeyName + "</size>", Array.Empty<GUILayoutOption>());
					bool flag = _listeningBind == keyBind;
					if (GUILayout.Button(flag ? "..." : $"[{keyBind.CurrentValue}]", (GUILayoutOption[])(object)new GUILayoutOption[2]
					{
						GUILayout.Width(85f),
						GUILayout.Height(20f)
					}))
					{
						_listeningBind = (flag ? null : keyBind);
					}
					GUILayout.EndHorizontal();
				}
				GUILayout.EndVertical();
			}
			GUILayout.EndScrollView();
			GUILayout.EndArea();
			float num6 = num5 + num2 - 36f;
			if (GUI.Button(new Rect(num4 + 10f, num6, 105f, 26f), IsEn ? "Lang: EN" : "Язык: RU", _solidBtnStyle))
			{
				_language.Value = (IsEn ? "RU" : "EN");
			}
			if (GUI.Button(new Rect(num4 + 122f, num6, 110f, 26f), T("Обновить", "Refresh"), _solidBtnStyle))
			{
				RefreshModList();
			}
			if (GUI.Button(new Rect(num4 + 239f, num6, 111f, 26f), T("Закрыть [F8]", "Close [F8]"), _redBtnStyle))
			{
				_isOpen = false;
			}
		}
	}
}