Decompiled source of GenoTESTIE v1.0.69

MoreHead.dll

Decompiled 11 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using MoreCompany.Cosmetics;
using MoreCompany.Utils;
using MoreHead.Cosmetics;
using MoreHead.MoreScript;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MoreHead")]
[assembly: AssemblyDescription("A head mod")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MoreHead")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("011E6CD3-31C5-43C5-8681-EC192737BD7F")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = "")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MoreHead
{
	[BepInPlugin("Mhz.MoreHead", "MoreHead", "1.1.3")]
	public class PluginOne : BaseUnityPlugin
	{
		private const string PluginGuid = "Mhz.MoreHead";

		private const string PluginName = "MoreHead";

		private const string PluginVersion = "1.1.3";

		private static Harmony _harmony;

		private bool _initialized;

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			if (_harmony == null)
			{
				_harmony = new Harmony("Mhz.MoreHead");
			}
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreHead OK");
		}

		public void Start()
		{
			if (_initialized)
			{
				_initialized = true;
				Init();
			}
		}

		public void OnDestroy()
		{
			if (!_initialized)
			{
				_initialized = true;
				Init();
			}
		}

		private void Init()
		{
			List<StreamCosmeticGeneric> cosmetics = new List<StreamCosmeticGeneric>
			{
				new YanCao(),
				new FanYanCao(),
				new MaoTou(),
				new Zhutou(),
				new Caomaoer(),
				new Dalalala(),
				new Heshuimao(),
				new Xiguamao(),
				new PaydayMask(),
				new Shoulianer(),
				new Shoubiaoer(),
				new Heijiaobu(),
				new Shouhuaner(),
				new Mianzhaoer(),
				new Koushuibudou(),
				new Gegedetou(),
				new Yashuaer(),
				new Yuguagua()
			};
			LoadAssets(cosmetics);
		}

		private void LoadAssets(IEnumerable<StreamCosmeticGeneric> cosmetics)
		{
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreHead Asset OK");
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			foreach (StreamCosmeticGeneric cosmetic in cosmetics)
			{
				AssetBundle val = BundleUtilities.LoadBundleFromInternalAssembly(cosmetic.StreamingPath, executingAssembly);
				GameObject val2 = AssetBundleExtension.LoadPersistentAsset<GameObject>(val, ((CosmeticGeneric)cosmetic).gameObjectPath);
				if ((Object)(object)val2 == (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)("Failed to find GameObject for cosmetic '" + ((CosmeticGeneric)cosmetic).cosmeticId + "' at path '" + ((CosmeticGeneric)cosmetic).gameObjectPath + "'"));
					continue;
				}
				if (((CosmeticGeneric)cosmetic).cosmeticId == "morehead.fanxiangyan")
				{
					GameObject gameObject = ((Component)val2.transform.Find("cigarette/yan/yanlizi")).gameObject;
					if ((Object)(object)gameObject == (Object)null)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"No fanxiangyanlizi!");
					}
					else
					{
						gameObject.AddComponent<Huanse>();
						((BaseUnityPlugin)this).Logger.LogWarning((object)"fanxiangyanlizi ok.");
					}
				}
				Texture2D val3 = AssetBundleExtension.LoadPersistentAsset<Texture2D>(val, ((CosmeticGeneric)cosmetic).textureIconPath);
				if ((Object)(object)val3 == (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)("Failed to find icon Texture2D for cosmetic '" + ((CosmeticGeneric)cosmetic).cosmeticId + " at path '" + ((CosmeticGeneric)cosmetic).textureIconPath + "'"));
				}
				else
				{
					CosmeticInstance val4 = val2.AddComponent<CosmeticInstance>();
					val4.cosmeticId = ((CosmeticGeneric)cosmetic).cosmeticId;
					val4.icon = val3;
					val4.cosmeticType = ((CosmeticGeneric)cosmetic).cosmeticType;
					CosmeticRegistry.cosmeticInstances.Add(((CosmeticGeneric)cosmetic).cosmeticId, val4);
					((BaseUnityPlugin)this).Logger.LogInfo((object)("Successfully loaded cosmetic: " + ((CosmeticGeneric)cosmetic).cosmeticId));
				}
			}
		}
	}
}
namespace MoreHead.Cosmetics
{
	public abstract class StreamCosmeticGeneric : CosmeticGeneric
	{
		public virtual string StreamingPath => string.Empty;
	}
	public class YanCao : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.yan";

		public override string gameObjectPath => "Assets/MoreHead/Yan.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/YanTu.png";

		public override string StreamingPath => "morehead.more.yan1";
	}
	public class FanYanCao : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.fanxiangyan";

		public override string gameObjectPath => "Assets/MoreHead/Fanxiangyan.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Fanxiangyantu.png";

		public override string StreamingPath => "morehead.more.yan2";
	}
	public class MaoTou : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.cathead";

		public override string gameObjectPath => "Assets/MoreHead/CatHead.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Cattu.png";

		public override string StreamingPath => "morehead.more.cathead";
	}
	public class Zhutou : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.pighead";

		public override string gameObjectPath => "Assets/MoreHead/PigHead.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Zhutu.png";

		public override string StreamingPath => "morehead.more.pighead";
	}
	public class Caomaoer : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.caomao";

		public override string gameObjectPath => "Assets/MoreHead/CaoMao.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Caomaotu.png";

		public override string StreamingPath => "morehead.more.caomao";
	}
	public class Dalalala : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.xiangsuyanjing";

		public override string gameObjectPath => "Assets/MoreHead/YanJingEr.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Xiangsuyanjingtu.png";

		public override string StreamingPath => "morehead.more.yanjinger";
	}
	public class Heshuimao : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.shuimao";

		public override string gameObjectPath => "Assets/MoreHead/ShuiMao.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Shuimaotu.png";

		public override string StreamingPath => "morehead.more.shuimaoer";
	}
	public class Xiguamao : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.xiguatou";

		public override string gameObjectPath => "Assets/MoreHead/XiguaTou.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Xiguatu.png";

		public override string StreamingPath => "morehead.more.xiguanaodai";
	}
	public class PaydayMask : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.dallas";

		public override string gameObjectPath => "Assets/MoreHead/DallasMask.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Masktu.png";

		public override string StreamingPath => "morehead.more.paydaytou";
	}
	public class Shoulianer : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.shoulian";

		public override string gameObjectPath => "Assets/MoreHead/Shoulian.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Shouliantu.png";

		public override string StreamingPath => "morehead.more.shoulian";
	}
	public class Shoubiaoer : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.biao";

		public override string gameObjectPath => "Assets/MoreHead/Biao.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Biaotu.png";

		public override string StreamingPath => "morehead.more.shoubiao";
	}
	public class Heijiaobu : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.heiweijin";

		public override string gameObjectPath => "Assets/MoreHead/Heiweijin.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Heiweijintu.png";

		public override string StreamingPath => "morehead.more.dianjiaobu";
	}
	public class Shouhuaner : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.jinshouhuan";

		public override string gameObjectPath => "Assets/MoreHead/Jinshouhuan.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Jinshouhuantu.png";

		public override string StreamingPath => "morehead.more.jinshouhuan";
	}
	public class Mianzhaoer : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.mianzhao";

		public override string gameObjectPath => "Assets/MoreHead/Mianzhao.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Mianzhaotu.png";

		public override string StreamingPath => "morehead.more.mianzhao";
	}
	public class Koushuibudou : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.koushuibu";

		public override string gameObjectPath => "Assets/MoreHead/Koushuibu.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Koushuibutu.png";

		public override string StreamingPath => "morehead.more.koushuibudou";
	}
	public class Gegedetou : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.kunkuntou";

		public override string gameObjectPath => "Assets/MoreHead/Kuntou.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Kuntoutu.png";

		public override string StreamingPath => "morehead.more.kunkundetou";
	}
	public class Yashuaer : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.yashua";

		public override string gameObjectPath => "Assets/MoreHead/Yashuashuaya.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Yashuatu.png";

		public override string StreamingPath => "morehead.more.shuayaya";
	}
	public class Yuguagua : StreamCosmeticGeneric
	{
		public override string cosmeticId => "morehead.yuguaqi";

		public override string gameObjectPath => "Assets/MoreHead/Yugua.prefab";

		public override string textureIconPath => "Assets/MoreHead/ICON/Yuguatu.png";

		public override string StreamingPath => "morehead.more.yuguagua";
	}
}
namespace MoreHead.MoreScript
{
	public class Huanse : MonoBehaviour
	{
		private ParticleSystem _particle;

		private void Start()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			_particle = ((Component)this).GetComponent<ParticleSystem>();
			if ((Object)(object)_particle == (Object)null)
			{
				Debug.LogError((object)"NO ParticleSystem.");
				return;
			}
			MainModule main = _particle.main;
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "MainMenu")
			{
				Color val = default(Color);
				((Color)(ref val))..ctor(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
				((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val);
				PlayerPrefs.SetString("SavedColor", ColorUtility.ToHtmlStringRGB(val));
				PlayerPrefs.Save();
			}
			else
			{
				string @string = PlayerPrefs.GetString("SavedColor", "");
				if (!string.IsNullOrEmpty(@string))
				{
					@string = "#" + @string;
					Color val2 = default(Color);
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(ColorUtility.TryParseHtmlString(@string, ref val2) ? val2 : Color.yellow);
				}
			}
			MinMaxGradient startColor = ((MainModule)(ref main)).startColor;
			Debug.LogWarning((object)((MinMaxGradient)(ref startColor)).color);
		}
	}
}

PippoLaPippa.dll

Decompiled 11 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using MoreCompany.Cosmetics;
using MoreCompany.Utils;
using Test.Cosmetics;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fb6e6c68-72c9-48be-a4f8-8914138efdf4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Test
{
	[BepInPlugin("Pippo.PippoModel", "Pippo Model", "1.0.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "Pippo.PippoModel";

		private const string modName = "Pippo Model";

		private const string modVersion = "1.0.0.0";

		private static Harmony _harmony;

		private bool _initialized;

		private static Plugin istance;

		public static ManualLogSource mls;

		static Plugin()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			mls = Logger.CreateLogSource("Pippo.PippoModel");
			_harmony = new Harmony("Pippo.PippoModel");
		}

		private void Awake()
		{
			if ((Object)(object)istance == (Object)null)
			{
				istance = this;
			}
			_harmony.PatchAll();
			mls.LogInfo((object)"Pippo Model loaded!");
		}

		public void Start()
		{
			if (_initialized)
			{
				_initialized = true;
				Init();
			}
		}

		public void OnDestroy()
		{
			if (!_initialized)
			{
				_initialized = true;
				Init();
			}
		}

		private void Init()
		{
			List<StreamCosmeticGeneric> cosmetics = new List<StreamCosmeticGeneric>
			{
				new Gabibbo(),
				new KrustyHatFixed(),
				new MortyHead(),
				new RickHead(),
				new Squidward(),
				new WalterWhite()
			};
			LoadAssets(cosmetics);
		}

		private void LoadAssets(IEnumerable<StreamCosmeticGeneric> cosmetics)
		{
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			mls.LogInfo((object)"Loading assets for LRCCosmetics");
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if ((object)executingAssembly == null)
			{
				mls.LogError((object)"Failed to get assemlby.");
			}
			foreach (StreamCosmeticGeneric cosmetic in cosmetics)
			{
				AssetBundle val = BundleUtilities.LoadBundleFromInternalAssembly(cosmetic.StreamingPath, executingAssembly);
				GameObject val2 = AssetBundleExtension.LoadPersistentAsset<GameObject>(val, ((CosmeticGeneric)cosmetic).gameObjectPath);
				if ((Object)(object)val2 == (Object)null)
				{
					mls.LogError((object)("Failed to find GameObject for cosmetic '" + ((CosmeticGeneric)cosmetic).cosmeticId + "' at path '" + ((CosmeticGeneric)cosmetic).gameObjectPath + "'"));
					continue;
				}
				Texture2D val3 = AssetBundleExtension.LoadPersistentAsset<Texture2D>(val, ((CosmeticGeneric)cosmetic).textureIconPath);
				if ((Object)(object)val3 == (Object)null)
				{
					mls.LogError((object)("Failed to find icon Texture2D for cosmetic '" + ((CosmeticGeneric)cosmetic).cosmeticId + " at path '" + ((CosmeticGeneric)cosmetic).textureIconPath + "'"));
				}
				else
				{
					CosmeticInstance val4 = val2.AddComponent<CosmeticInstance>();
					val4.cosmeticId = ((CosmeticGeneric)cosmetic).cosmeticId;
					val4.icon = val3;
					val4.cosmeticType = ((CosmeticGeneric)cosmetic).cosmeticType;
					CosmeticRegistry.cosmeticInstances.Add(((CosmeticGeneric)cosmetic).cosmeticId, val4);
					mls.LogInfo((object)("Successfully loaded cosmetic: " + ((CosmeticGeneric)cosmetic).cosmeticId));
				}
				string[] allAssetNames = val.GetAllAssetNames();
				string[] array = allAssetNames;
				foreach (string text in array)
				{
					mls.LogInfo((object)text);
				}
			}
		}
	}
}
namespace Test.Cosmetics
{
	public class KrustyHatFixed : StreamCosmeticGeneric
	{
		public override string cosmeticId => "pippomodel.krustyhat";

		public override string gameObjectPath => "Assets/Model/krusty_hat/krusty_hat.prefab";

		public override string textureIconPath => "Assets/Model/krusty_hat/krusty_hat_icon.png";

		public override string StreamingPath => "Test.Resources.krusty-hat";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class WalterWhite : StreamCosmeticGeneric
	{
		public override string cosmeticId => "pippomodel.walter_white";

		public override string gameObjectPath => "Assets/Model/walter_white/walter_white.prefab";

		public override string textureIconPath => "Assets/Model/walter_white/walter_white_icon.png";

		public override string StreamingPath => "Test.Resources.walter-white";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class RickHead : StreamCosmeticGeneric
	{
		public override string cosmeticId => "pippomodel.rick";

		public override string gameObjectPath => "Assets/Model/rick/rick.prefab";

		public override string textureIconPath => "Assets/Model/rick/rick_icon.png";

		public override string StreamingPath => "Test.Resources.rick";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class MortyHead : StreamCosmeticGeneric
	{
		public override string cosmeticId => "pippomodel.morty";

		public override string gameObjectPath => "Assets/Model/morty/morty.prefab";

		public override string textureIconPath => "Assets/Model/morty/morty_icon.png";

		public override string StreamingPath => "Test.Resources.morty";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class Gabibbo : StreamCosmeticGeneric
	{
		public override string cosmeticId => "pippomodel.gabibbo";

		public override string gameObjectPath => "Assets/Model/gabibbo/Gabibbo.prefab";

		public override string textureIconPath => "Assets/Model/gabibbo/gabibbo_icon.png";

		public override string StreamingPath => "Test.Resources.gabibbo";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class Squidward : StreamCosmeticGeneric
	{
		public override string cosmeticId => "pippomodel.squidward";

		public override string gameObjectPath => "Assets/Model/squidward/squidward.prefab";

		public override string textureIconPath => "Assets/Model/squidward/squidward_icon.png";

		public override string StreamingPath => "Test.Resources.squidward";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public abstract class StreamCosmeticGeneric : CosmeticGeneric
	{
		public virtual string StreamingPath => string.Empty;
	}
}

SaiCosmetics.dll

Decompiled 11 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreCompany.Cosmetics;
using MoreCompany.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("SaiCosmetics")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SaiCosmetics")]
[assembly: AssemblyTitle("SaiCosmetics")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace SaiCosmetics
{
	public class Dance : SaiCosmeticGeneric
	{
		public override string BundleName => "Dance";

		public override string BundlePath => "SaiCosmetics.dance";

		public override string cosmeticId => "sai.Dance";

		public CosmeticType cosType => (CosmeticType)0;
	}
	public class Doug : SaiCosmeticGeneric
	{
		public override string BundleName => "Doug";

		public override string BundlePath => "SaiCosmetics.doug";

		public override string cosmeticId => "sai.doug";

		public CosmeticType cosType => (CosmeticType)0;
	}
	public class Kid : SaiCosmeticGeneric
	{
		public override string BundleName => "kid";

		public override string BundlePath => "SaiCosmetics.kid";

		public override string cosmeticId => "sai.kid";

		public CosmeticType cosType => (CosmeticType)0;
	}
	[BepInPlugin("Sai.SaiCosmetics", "Sai's Bullshit Cosmetics", "1.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private static Harmony _harmony;

		private bool _initialized;

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			if (_harmony == null)
			{
				_harmony = new Harmony("Sai.SaiCosmetics");
			}
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin SaiCosmetics is loaded!");
			LoadAssets();
		}

		private void LoadAssets()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loading assets for SaiCosmetics");
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if (executingAssembly == null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Failed to get assembly.");
			}
			Type[] types = executingAssembly.GetTypes();
			foreach (Type type in types)
			{
				if (!(type == null) && type.IsSubclassOf(typeof(SaiCosmeticGeneric)))
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)$"Loading cosmetic: {type}");
					SaiCosmeticGeneric streamCosmeticGeneric2 = (SaiCosmeticGeneric)Activator.CreateInstance(type);
					loadBundle(streamCosmeticGeneric2);
				}
			}
			void loadBundle(SaiCosmeticGeneric streamCosmeticGeneric)
			{
				//IL_0090: 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)
				AssetBundle val = BundleUtilities.LoadBundleFromInternalAssembly(streamCosmeticGeneric.BundlePath, executingAssembly);
				GameObject val2 = AssetBundleExtension.LoadPersistentAsset<GameObject>(val, streamCosmeticGeneric.BundleName + ".prefab");
				if ((Object)(object)val2 == (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)("Failed to find GameObject for cosmetic '" + ((CosmeticGeneric)streamCosmeticGeneric).cosmeticId + "' at path '" + ((CosmeticGeneric)streamCosmeticGeneric).gameObjectPath + "'"));
				}
				else
				{
					CosmeticInstance component = val2.GetComponent<CosmeticInstance>();
					component.cosmeticId = ((CosmeticGeneric)streamCosmeticGeneric).cosmeticId;
					component.cosmeticType = streamCosmeticGeneric.CosType;
					CosmeticRegistry.cosmeticInstances.Add(((CosmeticGeneric)streamCosmeticGeneric).cosmeticId, component);
					((BaseUnityPlugin)this).Logger.LogInfo((object)("Successfully loaded cosmetic: " + ((CosmeticGeneric)streamCosmeticGeneric).cosmeticId));
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_ID = "SaiCosmetics";

		public const string PLUGIN_NAME = "Sai's Bullshit Cosmetics";

		public const string PLUGIN_VERSION = "1.1.0";

		public const string PLUGIN_GUID = "Sai.SaiCosmetics";
	}
	public class Rao : SaiCosmeticGeneric
	{
		public override string BundleName => "rao";

		public override string BundlePath => "SaiCosmetics.rao";

		public override string cosmeticId => "sai.rao";

		public CosmeticType cosType => (CosmeticType)0;
	}
	public class Rat : SaiCosmeticGeneric
	{
		public override string BundleName => "rat";

		public override string BundlePath => "SaiCosmetics.rat";

		public override string cosmeticId => "sai.rat";

		public CosmeticType cosType => (CosmeticType)0;
	}
	public class SaiCosmeticGeneric : CosmeticGeneric
	{
		public CosmeticType CosType;

		public virtual string BundleName { get; }

		public virtual string BundlePath { get; }
	}
	public class ShyGuy : SaiCosmeticGeneric
	{
		public override string BundleName => "ShyGuy";

		public override string BundlePath => "SaiCosmetics.shyguy";

		public override string cosmeticId => "sai.Shy";

		public CosmeticType cosType => (CosmeticType)0;
	}
}

WackyCosmetics.dll

Decompiled 11 months ago
using System;
using System.Collections.Generic;
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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreCompany.Cosmetics;
using MoreCompany.Utils;
using UnityEngine;
using WackyCosmetics.Cosmetics;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("EliteMasterEric")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("New interesting cosmetics for Lethal Company")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("WackyCosmetics")]
[assembly: AssemblyTitle("WackyCosmetics")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace WackyCosmetics
{
	public static class PluginInfo
	{
		public const string PLUGIN_ID = "WackyCosmetics";

		public const string PLUGIN_NAME = "EliteMasterEric's Wacky Cosmetics";

		public const string PLUGIN_VERSION = "1.0.0";

		public const string PLUGIN_GUID = "com.elitemastereric.wackycosmetics";
	}
	[BepInPlugin("com.elitemastereric.wackycosmetics", "EliteMasterEric's Wacky Cosmetics", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public ManualLogSource PluginLogger;

		public PluginConfig PluginConfig;

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			Instance = this;
			PluginLogger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("com.elitemastereric.wackycosmetics");
			val.PatchAll();
			PluginLogger.LogInfo((object)"Plugin EliteMasterEric's Wacky Cosmetics (com.elitemastereric.wackycosmetics) is loaded!");
			LoadConfig();
			LoadCosmetics();
		}

		private void LoadConfig()
		{
			PluginConfig = new PluginConfig();
			PluginConfig.BindConfig(((BaseUnityPlugin)this).Config);
		}

		private void LoadCosmetics()
		{
			WackyCosmeticGeneric.LoadCosmeticsFromThisAssembly();
		}
	}
	internal class PluginAssets
	{
		public static AssetBundle LoadBundleFromThisAssembly(string filename)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if (executingAssembly == null)
			{
				Plugin.Instance.PluginLogger.LogError((object)("Failed to get assembly reference while loading bundle: " + filename));
				return null;
			}
			return BundleUtilities.LoadBundleFromInternalAssembly(filename, executingAssembly);
		}

		public static string[] ListEmbeddedResourcesInThisAssembly()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if (executingAssembly == null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Failed to get assembly reference while listing embedded resources.");
				return null;
			}
			return executingAssembly.GetManifestResourceNames();
		}
	}
	public class PluginConfig
	{
		public Dictionary<string, ConfigEntry<bool>> CosmeticConfigEntries;

		public PluginConfig()
		{
			CosmeticConfigEntries = new Dictionary<string, ConfigEntry<bool>>();
		}

		public void BindConfig(ConfigFile config)
		{
			WackyCosmeticGeneric.GenerateCosmeticConfigEntries(config);
		}

		internal void GenerateCosmeticConfigEntry(ConfigFile config, WackyCosmeticGeneric cosmetic)
		{
			ConfigEntry<bool> value = config.Bind<bool>("Cosmetics", "EnableCosmetic_" + ((CosmeticGeneric)cosmetic).cosmeticId, true, "Enable the " + cosmetic.cosmeticName + " cosmetic.");
			CosmeticConfigEntries.Add(((CosmeticGeneric)cosmetic).cosmeticId, value);
		}

		public bool IsCosmeticEnabled(WackyCosmeticGeneric cosmetic)
		{
			return CosmeticConfigEntries[((CosmeticGeneric)cosmetic).cosmeticId].Value;
		}
	}
}
namespace WackyCosmetics.Cosmetics
{
	public class BurningFlamesTeamCaptain : WackyCosmeticGeneric
	{
		public override string gameObjectPath => "assets/WackyCosmetics/BurningFlamesTeamCaptain/BurningFlamesTeamCaptain.prefab";

		public override string cosmeticId => "wackycosmetics.burningflamesteamcaptain";

		public override string textureIconPath => "assets/WackyCosmetics/BurningFlamesTeamCaptain/BurningFlamesTeamCaptain_Icon.png";

		public override string cosmeticName => "Burning Flames Team Captain";

		public override string assetBundlePath => "WackyCosmetics.cosmetic_burningflamesteamcaptain";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class Maxwell : WackyCosmeticGeneric
	{
		public override string gameObjectPath => "assets/WackyCosmetics/Maxwell/Maxwell.prefab";

		public override string cosmeticId => "wackycosmetics.maxwell";

		public override string textureIconPath => "assets/WackyCosmetics/Maxwell/Maxwell_Icon.png";

		public override string cosmeticName => "Maxwell";

		public override string assetBundlePath => "WackyCosmetics.cosmetic_maxwell";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class OSCAR : WackyCosmeticGeneric
	{
		public override string gameObjectPath => "assets/WackyCosmetics/OSCAR/OSCAR.prefab";

		public override string cosmeticId => "wackycosmetics.oscar";

		public override string textureIconPath => "assets/WackyCosmetics/OSCAR/OSCAR_Icon.png";

		public override string cosmeticName => "OSCAR";

		public override string assetBundlePath => "WackyCosmetics.cosmetic_oscar";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class TBHCreature : WackyCosmeticGeneric
	{
		public override string gameObjectPath => "assets/WackyCosmetics/TBHCreature/TBHCreature.prefab";

		public override string cosmeticId => "wackycosmetics.tbhcreature";

		public override string textureIconPath => "assets/WackyCosmetics/TBHCreature/TBHCreature_Icon.png";

		public override string cosmeticName => "TBHCreature";

		public override string assetBundlePath => "WackyCosmetics.cosmetic_tbhcreature";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class ToweringPillarOfHats : WackyCosmeticGeneric
	{
		public override string gameObjectPath => "assets/WackyCosmetics/ToweringPillarOfHats/ToweringPillarOfHats.prefab";

		public override string cosmeticId => "wackycosmetics.toweringpillarofhats";

		public override string textureIconPath => "assets/WackyCosmetics/ToweringPillarOfHats/ToweringPillarOfHats_Icon.png";

		public override string cosmeticName => "Towering Pillar of Hats";

		public override string assetBundlePath => "WackyCosmetics.cosmetic_toweringpillarofhats";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class ValkyrieHelm : WackyCosmeticGeneric
	{
		public override string gameObjectPath => "assets/WackyCosmetics/ValkyrieHelm/ValkyrieHelm.prefab";

		public override string cosmeticId => "wackycosmetics.valkyriehelm";

		public override string textureIconPath => "assets/WackyCosmetics/ValkyrieHelm/ValkyrieHelm_Icon.png";

		public override string cosmeticName => "ValkyrieHelm";

		public override string assetBundlePath => "WackyCosmetics.cosmetic_valkyriehelm";

		public override CosmeticType cosmeticType => (CosmeticType)0;
	}
	public class WackyCosmeticGeneric : CosmeticGeneric
	{
		public virtual string cosmeticName { get; }

		public virtual string assetBundlePath { get; }

		public AssetBundle assetBundle { get; private set; }

		public void LoadFromAssetBundle()
		{
			//IL_012b: 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)
			if (!Plugin.Instance.PluginConfig.IsCosmeticEnabled(this))
			{
				Plugin.Instance.PluginLogger.LogInfo((object)("Skipped Wacky cosmetic: " + ((CosmeticGeneric)this).cosmeticId));
				return;
			}
			assetBundle = PluginAssets.LoadBundleFromThisAssembly(assetBundlePath);
			if ((Object)(object)assetBundle == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)("Failed to load cosmetic asset bundle: " + assetBundlePath));
				return;
			}
			GameObject val = AssetBundleExtension.LoadPersistentAsset<GameObject>(assetBundle, ((CosmeticGeneric)this).gameObjectPath);
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)("Failed to load cosmetic prefab: " + ((CosmeticGeneric)this).gameObjectPath));
				return;
			}
			Texture2D val2 = AssetBundleExtension.LoadPersistentAsset<Texture2D>(assetBundle, ((CosmeticGeneric)this).textureIconPath);
			if ((Object)(object)val2 == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)("Failed to load cosmetic icon: " + ((CosmeticGeneric)this).textureIconPath));
				return;
			}
			CosmeticInstance val3 = val.AddComponent<CosmeticInstance>();
			val3.cosmeticId = ((CosmeticGeneric)this).cosmeticId;
			val3.icon = val2;
			val3.cosmeticType = ((CosmeticGeneric)this).cosmeticType;
			CosmeticRegistry.cosmeticInstances.Add(((CosmeticGeneric)this).cosmeticId, val3);
			Plugin.Instance.PluginLogger.LogInfo((object)("Loaded Wacky cosmetic: " + ((CosmeticGeneric)this).cosmeticId));
		}

		public static void GenerateCosmeticConfigEntries(ConfigFile config)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if (executingAssembly == null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Failed to get assembly reference while generating config entries.");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Generating config entries for Wacky cosmetics.");
			Type[] types = executingAssembly.GetTypes();
			foreach (Type type in types)
			{
				if (!(type == null) && type.IsSubclassOf(typeof(WackyCosmeticGeneric)))
				{
					WackyCosmeticGeneric cosmetic = (WackyCosmeticGeneric)Activator.CreateInstance(type);
					Plugin.Instance.PluginConfig.GenerateCosmeticConfigEntry(config, cosmetic);
				}
			}
		}

		public static void LoadCosmeticsFromThisAssembly()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			if (executingAssembly == null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Failed to get assembly reference while loading cosmetics.");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Loading Wacky cosmetics.");
			Type[] types = executingAssembly.GetTypes();
			foreach (Type type in types)
			{
				if (!(type == null) && type.IsSubclassOf(typeof(WackyCosmeticGeneric)))
				{
					WackyCosmeticGeneric wackyCosmeticGeneric = (WackyCosmeticGeneric)Activator.CreateInstance(type);
					wackyCosmeticGeneric.LoadFromAssetBundle();
				}
			}
		}
	}
}