Decompiled source of SmoreSkinColors v1.1.0

plugins/SmoreSkinColors.dll

Decompiled a day 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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SmoreSkinColors")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("SmoreSkinColors")]
[assembly: AssemblyTitle("SmoreSkinColors")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.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 ColorMod
{
	[BepInPlugin("SmoreSkinColors", "SmoreSkinColors", "1.1.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_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: 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_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: 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_00ab: 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)
				//IL_00d1: 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_00f7: 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)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_013a: 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_015d: Unknown result type (might be due to invalid IL or missing references)
				//IL_017e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e4: 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_0207: Unknown result type (might be due to invalid IL or missing references)
				//IL_020c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_022c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0245: Unknown result type (might be due to invalid IL or missing references)
				//IL_024a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0265: Unknown result type (might be due to invalid IL or missing references)
				//IL_026a: 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_028d: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0304: Unknown result type (might be due to invalid IL or missing references)
				//IL_0309: Unknown result type (might be due to invalid IL or missing references)
				//IL_0327: Unknown result type (might be due to invalid IL or missing references)
				//IL_032c: 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_034e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0369: Unknown result type (might be due to invalid IL or missing references)
				//IL_036e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0388: 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)
				Customization component = ((Component)__instance).GetComponent<Customization>();
				CreateSkinOption(component, "Skin_FireBrick", Color32.op_Implicit(new Color32((byte)178, (byte)34, (byte)34, (byte)1)));
				CreateSkinOption(component, "Skin_SurskitBlue", Color32.op_Implicit(new Color32((byte)105, (byte)190, (byte)226, (byte)1)));
				CreateSkinOption(component, "Skin_Teal", Color32.op_Implicit(new Color32((byte)0, (byte)128, (byte)128, (byte)1)));
				CreateSkinOption(component, "Skin_CoralPink", Color32.op_Implicit(new Color32((byte)248, (byte)131, (byte)121, (byte)1)));
				CreateSkinOption(component, "Skin_Lavender", Color32.op_Implicit(new Color32((byte)220, (byte)208, byte.MaxValue, (byte)1)));
				CreateSkinOption(component, "Skin_MintGreen", Color32.op_Implicit(new Color32((byte)186, byte.MaxValue, (byte)171, (byte)1)));
				CreateSkinOption(component, "Skin_Vanilla", Color32.op_Implicit(new Color32((byte)243, (byte)229, (byte)171, (byte)1)));
				CreateSkinOption(component, "Skin_Chocolate", Color32.op_Implicit(new Color32((byte)132, (byte)86, (byte)60, (byte)1)));
				CreateSkinOption(component, "Skin_Strawberry", Color32.op_Implicit(new Color32((byte)252, (byte)90, (byte)141, (byte)1)));
				CreateSkinOption(component, "Skin_PastelOrange", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)156, (byte)89, (byte)1)));
				CreateSkinOption(component, "Skin_PastelBlue", Color32.op_Implicit(new Color32((byte)167, (byte)199, (byte)231, (byte)1)));
				CreateSkinOption(component, "Skin_PastelPink", Color32.op_Implicit(new Color32((byte)253, (byte)180, (byte)187, (byte)1)));
				CreateSkinOption(component, "Skin_WildBerry", Color32.op_Implicit(new Color32((byte)36, (byte)21, (byte)113, (byte)1)));
				CreateSkinOption(component, "Skin_Sapphire", Color32.op_Implicit(new Color32((byte)82, (byte)178, (byte)191, (byte)1)));
				CreateSkinOption(component, "Skin_Aquamarine", Color32.op_Implicit(new Color32((byte)123, (byte)253, (byte)199, (byte)1)));
				CreateSkinOption(component, "Skin_Rose", Color32.op_Implicit(new Color32((byte)227, (byte)36, (byte)43, (byte)1)));
				CreateSkinOption(component, "Skin_Ruby", Color32.op_Implicit(new Color32((byte)144, (byte)6, (byte)3, (byte)1)));
				CreateSkinOption(component, "Skin_Blush", Color32.op_Implicit(new Color32((byte)188, (byte)84, (byte)75, (byte)1)));
				CreateSkinOption(component, "Skin_Pear", Color32.op_Implicit(new Color32((byte)209, (byte)226, (byte)49, (byte)1)));
				CreateSkinOption(component, "Skin_Pickle", Color32.op_Implicit(new Color32((byte)89, (byte)125, (byte)53, (byte)1)));
				CreateSkinOption(component, "Skin_Pine", Color32.op_Implicit(new Color32((byte)35, (byte)79, (byte)30, (byte)1)));
				CreateSkinOption(component, "Skin_Parakeet", Color32.op_Implicit(new Color32((byte)3, (byte)192, (byte)74, (byte)1)));
				CreateSkinOption(component, "Skin_Orchid", Color32.op_Implicit(new Color32((byte)218, (byte)112, (byte)214, (byte)1)));
				CreateSkinOption(component, "Skin_Heather", Color32.op_Implicit(new Color32((byte)158, (byte)123, (byte)181, (byte)1)));
				CreateSkinOption(component, "Skin_Honey", Color32.op_Implicit(new Color32((byte)249, (byte)201, (byte)1, (byte)1)));
				CreateSkinOption(component, "Skin_BurntSienna", Color32.op_Implicit(new Color32((byte)187, (byte)55, (byte)38, (byte)1)));
				CreateSkinOption(component, "Skin_Clay", Color32.op_Implicit(new Color32((byte)137, (byte)49, (byte)1, (byte)1)));
			}
		}

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

		public const string Id = "SmoreSkinColors";

		internal static ManualLogSource Log { get; private set; }

		public static string Name => "SmoreSkinColors";

		public static string Version => "1.1.0";

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			_harmony.PatchAll(typeof(Patcher));
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}