Decompiled source of ArcadeProgress v1.0.0

plugins/ArcadeProgress.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LLHandlers;
using LLScreen;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("ArcadeProgress")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ArcadeProgress")]
[assembly: AssemblyTitle("ArcadeProgress")]
[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 ArcadeProgress
{
	[BepInPlugin("com.github.daioutzu.arcadeprogress", "ArcadeProgress", "1.0.0")]
	[BepInProcess("LLBlaze.exe")]
	public class ArcadeProgress : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		internal static Harmony Harmony = new Harmony("com.github.daioutzu.arcadeprogress");

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Harmony.PatchAll(typeof(Patches));
			Logger.LogInfo((object)"Plugin com.github.daioutzu.arcadeprogress is loaded!");
			((Behaviour)this).enabled = false;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.github.daioutzu.arcadeprogress";

		public const string PLUGIN_NAME = "ArcadeProgress";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	internal static class Patches
	{
		[HarmonyPatch(typeof(ScreenPlayers), "AddCharacters")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> AddCheckMark(IEnumerable<CodeInstruction> instructions)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
			val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction il) => il.opcode == OpCodes.Callvirt && (il.operand as MethodBase).Name == "set_localRotation")).ThrowIfNotMatch("Didn't find set_localRotation", (CodeMatch[])(object)new CodeMatch[0]).Advance(1);
			val.Insert((CodeInstruction[])(object)new CodeInstruction[5]
			{
				new CodeInstruction(OpCodes.Ldloc_S, (object)(sbyte)5),
				new CodeInstruction(OpCodes.Ldarg_1, (object)null),
				new CodeInstruction(OpCodes.Ldloc_3, (object)null),
				new CodeInstruction(OpCodes.Callvirt, (object)typeof(List<Character>).GetMethod("get_Item")),
				Transpilers.EmitDelegate<Action<Transform, Character>>((Action<Transform, Character>)SetCheckMark)
			});
			return val.InstructionEnumeration();
		}

		private static void SetCheckMark(Transform transform, Character character)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Invalid comparison between Unknown and I4
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_007b: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			if ((int)DNPFJHMAIBP.OHBPPCEFBHI == 6 && (int)character <= 9 && EPCDKLCABNC.HGHKKPCAKOM(character))
			{
				GameObject val = new GameObject("CheckMark", new Type[3]
				{
					typeof(RectTransform),
					typeof(CanvasRenderer),
					typeof(Image)
				});
				val.transform.SetParent(transform, false);
				val.transform.localPosition = new Vector3(15f, -39f, 0f);
				val.transform.localScale = new Vector3(0.7f, 0.7f, 0.7f);
				AssetBundle assetBundle = BundleHandler.GetAssetBundle(new Bundle((BundleType)3));
				Image component = val.GetComponent<Image>();
				component.sprite = assetBundle.LoadAsset<Sprite>("_spriteCharacterCheck");
				((Graphic)component).SetNativeSize();
			}
		}
	}
}