Decompiled source of ModList v1.0.1

plugins/ModList.dll

Decompiled 6 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("ModList")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Modlist for ULTRAKILL")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+7e7e6ac63e327933811f8ace96f2d224b49d7a92")]
[assembly: AssemblyProduct("ModList")]
[assembly: AssemblyTitle("ModList")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public enum AnchorPresets
{
	TopLeft,
	TopCenter,
	TopRight,
	MiddleLeft,
	MiddleCenter,
	MiddleRight,
	BottomLeft,
	BottonCenter,
	BottomRight,
	BottomStretch,
	VertStretchLeft,
	VertStretchRight,
	VertStretchCenter,
	HorStretchTop,
	HorStretchMiddle,
	HorStretchBottom,
	StretchAll
}
public enum PivotPresets
{
	TopLeft,
	TopCenter,
	TopRight,
	MiddleLeft,
	MiddleCenter,
	MiddleRight,
	BottomLeft,
	BottomCenter,
	BottomRight
}
public struct Rect4
{
	public float top;

	public float bottom;

	public float left;

	public float right;

	public Rect4(float top, float bottom, float left, float right)
	{
		this.top = top;
		this.bottom = bottom;
		this.left = left;
		this.right = right;
	}
}
public static class RectTransformExtensions
{
	public static void SetAnchor(this RectTransform source, AnchorPresets allign, int offsetX = 0, int offsetY = 0)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: 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_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: 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_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: 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)
		//IL_0288: 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_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: 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)
		source.anchoredPosition = Vector2.op_Implicit(new Vector3((float)offsetX, (float)offsetY, 0f));
		switch (allign)
		{
		case AnchorPresets.TopLeft:
			source.anchorMin = new Vector2(0f, 1f);
			source.anchorMax = new Vector2(0f, 1f);
			break;
		case AnchorPresets.TopCenter:
			source.anchorMin = new Vector2(0.5f, 1f);
			source.anchorMax = new Vector2(0.5f, 1f);
			break;
		case AnchorPresets.TopRight:
			source.anchorMin = new Vector2(1f, 1f);
			source.anchorMax = new Vector2(1f, 1f);
			break;
		case AnchorPresets.MiddleLeft:
			source.anchorMin = new Vector2(0f, 0.5f);
			source.anchorMax = new Vector2(0f, 0.5f);
			break;
		case AnchorPresets.MiddleCenter:
			source.anchorMin = new Vector2(0.5f, 0.5f);
			source.anchorMax = new Vector2(0.5f, 0.5f);
			break;
		case AnchorPresets.MiddleRight:
			source.anchorMin = new Vector2(1f, 0.5f);
			source.anchorMax = new Vector2(1f, 0.5f);
			break;
		case AnchorPresets.BottomLeft:
			source.anchorMin = new Vector2(0f, 0f);
			source.anchorMax = new Vector2(0f, 0f);
			break;
		case AnchorPresets.BottonCenter:
			source.anchorMin = new Vector2(0.5f, 0f);
			source.anchorMax = new Vector2(0.5f, 0f);
			break;
		case AnchorPresets.BottomRight:
			source.anchorMin = new Vector2(1f, 0f);
			source.anchorMax = new Vector2(1f, 0f);
			break;
		case AnchorPresets.HorStretchTop:
			source.anchorMin = new Vector2(0f, 1f);
			source.anchorMax = new Vector2(1f, 1f);
			break;
		case AnchorPresets.HorStretchMiddle:
			source.anchorMin = new Vector2(0f, 0.5f);
			source.anchorMax = new Vector2(1f, 0.5f);
			break;
		case AnchorPresets.HorStretchBottom:
			source.anchorMin = new Vector2(0f, 0f);
			source.anchorMax = new Vector2(1f, 0f);
			break;
		case AnchorPresets.VertStretchLeft:
			source.anchorMin = new Vector2(0f, 0f);
			source.anchorMax = new Vector2(0f, 1f);
			break;
		case AnchorPresets.VertStretchCenter:
			source.anchorMin = new Vector2(0.5f, 0f);
			source.anchorMax = new Vector2(0.5f, 1f);
			break;
		case AnchorPresets.VertStretchRight:
			source.anchorMin = new Vector2(1f, 0f);
			source.anchorMax = new Vector2(1f, 1f);
			break;
		case AnchorPresets.StretchAll:
			source.anchorMin = new Vector2(0f, 0f);
			source.anchorMax = new Vector2(1f, 1f);
			break;
		case AnchorPresets.BottomStretch:
			break;
		}
	}

	public static void SetPivot(this RectTransform source, PivotPresets preset)
	{
		//IL_0036: 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_0062: 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_008e: 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_00ba: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
		switch (preset)
		{
		case PivotPresets.TopLeft:
			source.pivot = new Vector2(0f, 1f);
			break;
		case PivotPresets.TopCenter:
			source.pivot = new Vector2(0.5f, 1f);
			break;
		case PivotPresets.TopRight:
			source.pivot = new Vector2(1f, 1f);
			break;
		case PivotPresets.MiddleLeft:
			source.pivot = new Vector2(0f, 0.5f);
			break;
		case PivotPresets.MiddleCenter:
			source.pivot = new Vector2(0.5f, 0.5f);
			break;
		case PivotPresets.MiddleRight:
			source.pivot = new Vector2(1f, 0.5f);
			break;
		case PivotPresets.BottomLeft:
			source.pivot = new Vector2(0f, 0f);
			break;
		case PivotPresets.BottomCenter:
			source.pivot = new Vector2(0.5f, 0f);
			break;
		case PivotPresets.BottomRight:
			source.pivot = new Vector2(1f, 0f);
			break;
		}
	}

	public static void SetRect(this RectTransform source, Rect4 rect)
	{
		//IL_000d: 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)
		source.offsetMin = new Vector2(rect.left, rect.bottom);
		source.offsetMax = new Vector2(0f - rect.right, 0f - rect.top);
	}
}
namespace ModList
{
	public class ModMenu : MonoBehaviour
	{
		private Image? Icon;

		private TMP_Text? ModName;

		private TMP_Text? Author;

		private TMP_Text? Version;

		private TMP_Text? Description;

		private Button? ExitButton;

		private Button? OpenWebsiteButton;

		private Button? OpenThunderstoreButton;

		private TMP_InputField? Searchbox;

		private ScrollRect? Mods;

		private List<KeyValuePair<ModEntry, GameObject>> AllModsObjects = new List<KeyValuePair<ModEntry, GameObject>>();

		private List<KeyValuePair<ModEntry, GameObject>> FilteredMods = new List<KeyValuePair<ModEntry, GameObject>>();

		private ModEntry CurrentMod;

		public void SetCurrentMod(ModEntry mod)
		{
			CurrentMod = mod;
			Icon.sprite = mod.Icon;
			ModName.text = mod.Name;
			Author.text = "by " + mod.Author;
			Version.text = "v" + mod.BepInExVersion;
			Description.text = mod.Description;
			if (mod.IsFromThunderstore)
			{
				((Component)OpenThunderstoreButton).gameObject.SetActive(true);
			}
			else
			{
				((Component)OpenThunderstoreButton).gameObject.SetActive(false);
			}
			if (mod.AuthorWebsite != "")
			{
				((Component)OpenWebsiteButton).gameObject.SetActive(true);
			}
			else
			{
				((Component)OpenWebsiteButton).gameObject.SetActive(false);
			}
		}

		public void SetCurrentMod(GameObject g)
		{
			GameObject g2 = g;
			SetCurrentMod(AllModsObjects.Where<KeyValuePair<ModEntry, GameObject>>((KeyValuePair<ModEntry, GameObject> m) => (Object)(object)m.Value == (Object)(object)g2).First().Key);
		}

		private void Awake()
		{
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Expected O, but got Unknown
			Icon = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/ModInfo/Icon")).GetComponent<Image>();
			ModName = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/ModInfo/Icon/ModName")).GetComponent<TMP_Text>();
			Version = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/ModInfo/Icon/Version")).GetComponent<TMP_Text>();
			Author = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/ModInfo/Icon/Author")).GetComponent<TMP_Text>();
			Description = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/Description")).GetComponent<TMP_Text>();
			OpenWebsiteButton = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/Buttons/OpenWebsite")).GetComponent<Button>();
			((UnityEvent)OpenWebsiteButton.onClick).AddListener((UnityAction)delegate
			{
				Application.OpenURL(CurrentMod.AuthorWebsite);
			});
			((Component)OpenWebsiteButton).gameObject.SetActive(false);
			OpenThunderstoreButton = ((Component)((Component)this).transform.Find("Container/Mod/Viewport/Content/Buttons/ThunderstorePage")).GetComponent<Button>();
			((UnityEvent)OpenThunderstoreButton.onClick).AddListener((UnityAction)delegate
			{
				Application.OpenURL(CurrentMod.ThunderstoreUrl);
			});
			((Component)OpenThunderstoreButton).gameObject.SetActive(false);
			ExitButton = ((Component)((Component)this).transform.Find("Exit")).GetComponent<Button>();
			((UnityEvent)ExitButton.onClick).AddListener((UnityAction)delegate
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			});
			Searchbox = ((Component)((Component)this).transform.Find("SearchBox")).GetComponent<TMP_InputField>();
			((UnityEvent<string>)(object)Searchbox.onValueChanged).AddListener((UnityAction<string>)Search);
			Mods = ((Component)((Component)this).transform.Find("Container/Mods")).GetComponent<ScrollRect>();
			foreach (ModEntry mod in Plugin.Mods)
			{
				GameObject card = Object.Instantiate<GameObject>(Plugin.ModCardPrefab, (Transform)(object)Mods.content);
				GameObject obj = card;
				if (obj != null)
				{
					((UnityEvent)obj.AddComponent<Button>().onClick).AddListener((UnityAction)delegate
					{
						SetCurrentMod(card);
					});
				}
				if ((Object)(object)card != (Object)null)
				{
					AllModsObjects.Add(new KeyValuePair<ModEntry, GameObject>(mod, card));
					((Component)card.transform.Find("Icon")).GetComponent<Image>().sprite = mod.Icon;
					((Component)card.transform.Find("Icon/ModName")).GetComponent<TMP_Text>().text = mod.Name;
					((Component)card.transform.Find("Icon/Version")).GetComponent<TMP_Text>().text = "v" + mod.BepInExVersion;
					((Component)card.transform.Find("Icon/Author")).GetComponent<TMP_Text>().text = "by " + mod.Author;
				}
			}
			SetCurrentMod(AllModsObjects.First().Key);
		}

		public void Search(string search)
		{
			string search2 = search;
			if (search2 == "")
			{
				foreach (KeyValuePair<ModEntry, GameObject> allModsObject in AllModsObjects)
				{
					allModsObject.Value.SetActive(true);
				}
			}
			FilteredMods = AllModsObjects.Where<KeyValuePair<ModEntry, GameObject>>((KeyValuePair<ModEntry, GameObject> m) => m.Key.Name.Contains(search2)).ToList();
			foreach (KeyValuePair<ModEntry, GameObject> allModsObject2 in AllModsObjects)
			{
				if (!FilteredMods.Contains(allModsObject2))
				{
					allModsObject2.Value.SetActive(false);
				}
				else
				{
					allModsObject2.Value.SetActive(true);
				}
			}
		}
	}
	[BepInPlugin("com.zeddevstuff.modlist", "ModList", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		public static List<ModEntry> Mods = new List<ModEntry>();

		private static AssetBundle? Bundle;

		internal static GameObject? ModmenuPrefab;

		internal static GameObject? ModCardPrefab;

		internal static GameObject? ModsButton;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ModList is loaded!");
		}

		private void Start()
		{
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Expected O, but got Unknown
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: 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_03bb: Expected O, but got Unknown
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			if (Mods.Count != 0)
			{
				return;
			}
			BaseUnityPlugin[] components = ((Component)this).gameObject.GetComponents<BaseUnityPlugin>();
			Bundle = AssetBundle.LoadFromMemory(Resource1.modlist);
			ModmenuPrefab = Bundle.LoadAsset<GameObject>("ModMenu");
			ModCardPrefab = Bundle.LoadAsset<GameObject>("ModCard");
			ModsButton = Bundle.LoadAsset<GameObject>("ModsButton");
			BaseUnityPlugin[] array = components;
			foreach (BaseUnityPlugin val in array)
			{
				AssemblyDescriptionAttribute customAttribute = ((object)val).GetType().Assembly.GetCustomAttribute<AssemblyDescriptionAttribute>();
				ModEntry item = new ModEntry();
				item.Name = val.Info.Metadata.Name;
				item.BepInExGuid = val.Info.Metadata.GUID;
				item.BepInExVersion = val.Info.Metadata.Version.ToString();
				string[] array2 = val.Info.Metadata.GUID.Split(new char[1] { '.' });
				item.Author = ((array2.Length >= 2) ? array2[1] : "Unknown Author");
				item.Description = (IsStringWhiteSpaceOrEmpty(customAttribute.Description) ? "No Description" : customAttribute.Description);
				DirectoryInfo directory = new FileInfo(((object)val).GetType().Assembly.Location).Directory;
				if (directory != null)
				{
					if (!directory.Name.Contains("plugins"))
					{
						directory = RecurseUntilParentIs(directory, "plugins") ?? directory;
						FileInfo fileInfo = directory.GetFiles("manifest.json").FirstOrDefault();
						if (fileInfo != null)
						{
							JObject val2 = null;
							try
							{
								val2 = JsonConvert.DeserializeObject<JObject>(File.ReadAllText(fileInfo.FullName));
							}
							catch
							{
								((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to parse manifest.json for " + item.Name));
							}
							if (val2 != null)
							{
								FileInfo fileInfo2 = fileInfo.Directory.GetFiles("icon.png").FirstOrDefault();
								Texture2D val3 = new Texture2D(256, 256);
								if (fileInfo2 != null)
								{
									ImageConversion.LoadImage(val3, File.ReadAllBytes(fileInfo2.FullName));
								}
								else
								{
									ImageConversion.LoadImage(val3, Resource1.noicon);
								}
								item.Icon = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f));
								((Object)item.Icon).name = ((fileInfo2 != null) ? fileInfo2.Name : "NoIcon");
								item.IsFromThunderstore = true;
								if (val2.GetValue("description") != null)
								{
									item.Description = ((object)val2.GetValue("description")).ToString();
								}
								string text = ((object)val2.GetValue("name"))?.ToString() ?? "";
								if (text != "")
								{
									item.Name = text;
								}
								item.ThunderstoreVersion = ((object)val2.GetValue("version_number"))?.ToString() ?? "";
								string text2 = ((object)val2.GetValue("website_url"))?.ToString() ?? "";
								item.AuthorWebsite = ((text2 != "") ? text2 : "");
								string text3 = fileInfo.Directory.Name.Replace("-" + text, "");
								item.ThunderstoreUrl = "https://thunderstore.io/c/ultrakill/p/" + text3 + "/" + text;
								item.ThunderstoreGuid = fileInfo.Directory.Name;
								item.Author = text3;
							}
						}
					}
					else
					{
						Texture2D val4 = new Texture2D(256, 256);
						ImageConversion.LoadImage(val4, Resource1.noicon);
						item.Icon = Sprite.Create(val4, new Rect(0f, 0f, (float)((Texture)val4).width, (float)((Texture)val4).height), new Vector2(0.5f, 0.5f));
						((Object)item.Icon).name = "NoIcon";
					}
				}
				Mods.Add(item);
			}
			Mods = Mods.OrderBy((ModEntry m) => m.Name).ToList();
			SceneManager.sceneLoaded += AddButton;
		}

		private void AddButton(Scene s, LoadSceneMode mode)
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			if (!SceneHelper.CurrentScene.Contains("Menu"))
			{
				return;
			}
			GameObject gameObject = ((Component)(from c in ((Scene)(ref s)).GetRootGameObjects()
				where ((Object)c).name == "Canvas"
				select c).First().transform.Find("Main Menu (1)")).gameObject;
			if (!((Object)(object)gameObject.transform.Find("ModsButton") == (Object)null))
			{
				return;
			}
			GameObject obj = Object.Instantiate<GameObject>(ModsButton, (Transform)(object)gameObject.GetComponent<RectTransform>());
			if (obj != null)
			{
				((UnityEvent)obj.GetComponentInChildren<Button>().onClick).AddListener((UnityAction)delegate
				{
					OpenModMenu();
				});
			}
			RectTransform val = ((obj != null) ? obj.GetComponent<RectTransform>() : null);
			if ((Object)(object)val != (Object)null)
			{
				val.SetPivot(PivotPresets.BottomLeft);
				val.SetAnchor(AnchorPresets.BottomLeft);
				val.anchoredPosition = new Vector2(5f, 5f);
			}
		}

		private DirectoryInfo? RecurseUntilParentIs(DirectoryInfo dir, string target)
		{
			DirectoryInfo directoryInfo = dir;
			while (directoryInfo.Parent.Name != target)
			{
				if (directoryInfo.Parent == null)
				{
					return null;
				}
				directoryInfo = directoryInfo.Parent;
			}
			return directoryInfo;
		}

		private void OpenModMenu()
		{
			RectTransform component = GameObject.Find("Canvas").GetComponent<RectTransform>();
			Object.Instantiate<GameObject>(ModmenuPrefab, (Transform)(object)component).AddComponent<ModMenu>();
		}

		public static T AorB<T>(T a, T b, Func<bool> condition)
		{
			if (!condition())
			{
				return b;
			}
			return a;
		}

		private static bool IsStringWhiteSpaceOrEmpty(string str)
		{
			if (str.Length != 0)
			{
				return str.All((char c) => char.IsWhiteSpace(c));
			}
			return true;
		}
	}
	public struct ModEntry
	{
		public Sprite? Icon;

		public string Name;

		public string Author;

		public string BepInExGuid;

		public string ThunderstoreGuid;

		public string BepInExVersion;

		public string ThunderstoreVersion;

		public string Description;

		public string AuthorWebsite;

		public string ThunderstoreUrl;

		public bool IsFromThunderstore;

		public ModEntry()
		{
			Icon = null;
			Name = "";
			Author = "";
			BepInExGuid = "";
			ThunderstoreGuid = "";
			BepInExVersion = "";
			ThunderstoreVersion = "";
			Description = "";
			AuthorWebsite = "";
			ThunderstoreUrl = "";
			IsFromThunderstore = false;
		}
	}
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resource1
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					resourceMan = new ResourceManager("ModList.Resource1", typeof(Resource1).Assembly);
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static byte[] modlist => (byte[])ResourceManager.GetObject("modlist", resourceCulture);

		internal static byte[] noicon => (byte[])ResourceManager.GetObject("noicon", resourceCulture);

		internal Resource1()
		{
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ModList";

		public const string PLUGIN_NAME = "ModList";

		public const string PLUGIN_VERSION = "1.0.1";
	}
}