Decompiled source of MoreColourOptions v1.0.0

plugins/com.cakedevs.morecolouroptions.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.cakedevs.morecolouroptions")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("com.cakedevs.morecolouroptions")]
[assembly: AssemblyTitle("MoreColourOptions")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace MoreColourOptions
{
	[BepInPlugin("com.cakedevs.morecolouroptions", "MoreColourOptions", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private class Patcher
		{
			private static bool CreateSkinOption(Customization customization, string name, Color color)
			{
				//IL_000e: 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_0050: 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_007b: Unknown result type (might be due to invalid IL or missing references)
				string name2 = name;
				if (Array.Exists(customization.skins, (CustomizationOption skin) => ((Object)skin).name == name2) || Array.Exists(customization.skins, (CustomizationOption skin) => skin.color == color))
				{
					return false;
				}
				CustomizationOption val = ScriptableObject.CreateInstance<CustomizationOption>();
				val.color = color;
				((Object)val).name = name2;
				val.texture = customization.skins[0].texture;
				val.type = (Type)0;
				customization.skins = CollectionExtensions.AddToArray<CustomizationOption>(customization.skins, val);
				return true;
			}

			[HarmonyPatch(typeof(PassportManager), "Awake")]
			[HarmonyPostfix]
			private static void PassportManagerAwakePostfix(PassportManager __instance)
			{
				//IL_001d: 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_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_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: 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_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_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				Customization component = ((Component)__instance).GetComponent<Customization>();
				CreateSkinOption(component, "Skin_White", Color32.op_Implicit(new Color32((byte)200, (byte)200, (byte)200, (byte)1)));
				CreateSkinOption(component, "Skin_Gray", Color.gray);
				CreateSkinOption(component, "Skin_DarkGreen", Color32.op_Implicit(new Color32((byte)0, (byte)89, (byte)0, (byte)1)));
				CreateSkinOption(component, "Skin_PastelPink", Color32.op_Implicit(new Color32((byte)228, (byte)106, (byte)142, (byte)1)));
				CreateSkinOption(component, "Skin_PastelPurple", Color32.op_Implicit(new Color32((byte)164, (byte)125, (byte)171, (byte)1)));
				CreateSkinOption(component, "Skin_TrueRed", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)0, (byte)0, (byte)1)));
				CreateSkinOption(component, "Skin_TrueYellow", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, (byte)0, (byte)1)));
				CreateSkinOption(component, "Skin_TrueBlue", Color32.op_Implicit(new Color32((byte)0, (byte)0, byte.MaxValue, (byte)1)));
				CreateSkinOption(component, "Skin_Brown", Color32.op_Implicit(new Color32((byte)132, (byte)83, (byte)33, (byte)1)));
			}
		}

		private readonly Harmony _harmony = new Harmony("com.cakedevs.morecolouroptions");

		public const string Id = "com.cakedevs.morecolouroptions";

		public static string Name => "MoreColourOptions";

		public static string Version => "1.0.0";

		private void Awake()
		{
			_harmony.PatchAll(typeof(Patcher));
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}