Decompiled source of P03FaceReplacer v1.0.0

P03FaceReplacer.dll

Decompiled 6 hours 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 DiskCardGame;
using HarmonyLib;
using InscryptionAPI.Helpers;
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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("P03FaceReplacer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Allows replacing P03's face")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("P03FaceReplacer")]
[assembly: AssemblyTitle("P03FaceReplacer")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace P03FaceReplacer
{
	[BepInPlugin("tvflabs.inscryption.P03FaceReplacer", "P03FaceReplacer", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(P03FaceRenderer), "DisplayFace")]
		private class P03FaceRenderer_DisplayFace_Patch
		{
			private static void Postfix(Face face, ref GameObject __result)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Invalid comparison between Unknown and I4
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Invalid comparison between Unknown and I4
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Invalid comparison between Unknown and I4
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Invalid comparison between Unknown and I4
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Invalid comparison between Unknown and I4
				if ((int)face == 0)
				{
					__result.GetComponent<SpriteRenderer>().sprite = TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture("p03_face_default.png", (FilterMode)0), (Vector2?)null);
				}
				else if ((int)face == 3)
				{
					__result.GetComponent<SpriteRenderer>().sprite = TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture("p03_face_impatient.png", (FilterMode)0), (Vector2?)null);
				}
				else if ((int)face == 4)
				{
					__result.GetComponent<SpriteRenderer>().sprite = TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture("p03_face_happy.png", (FilterMode)0), (Vector2?)null);
				}
				else if ((int)face == 36)
				{
					__result.GetComponent<SpriteRenderer>().sprite = TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture("p03_face_choking.png", (FilterMode)0), (Vector2?)null);
				}
				else if ((int)face == 37)
				{
					__result.GetComponent<SpriteRenderer>().sprite = TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture("p03_face_dying.png", (FilterMode)0), (Vector2?)null);
				}
			}
		}

		private Harmony harmony = new Harmony("tvflabs.inscryption.P03FaceReplacer");

		private const string PluginGuid = "tvflabs.inscryption.P03FaceReplacer";

		private const string PluginName = "P03FaceReplacer";

		private const string PluginVersion = "1.0.0";

		private const string PluginPrefix = "P03FaceReplacer";

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded P03FaceReplacer!");
			harmony.PatchAll();
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "P03FaceReplacer";

		public const string PLUGIN_NAME = "P03FaceReplacer";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}