Decompiled source of MoreSparks v1.1.0

plugins/com.github.daioutzu.moresparks.dll

Decompiled a week 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 Microsoft.CodeAnalysis;
using UnityEngine;

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

		internal Harmony harmony = new Harmony("com.github.daioutzu.moresparks");

		internal static MainMoreSparks Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin com.github.daioutzu.moresparks is loaded!");
			try
			{
				harmony.PatchAll(typeof(Spark_Patches));
			}
			catch (Exception)
			{
				Logger.LogFatal((object)"Failed to Patch 'MoreSparks' UnPatching Self");
				Instance.harmony.UnpatchSelf();
				throw;
			}
		}
	}
	internal class Spark_Patches
	{
		private const int NEW_MAX_CURRENCY = 999999;

		[HarmonyPatch(typeof(EPCDKLCABNC), "PGIEGPGNBHJ")]
		[HarmonyPatch(typeof(OEAINNHEMKA), "BKHKFPANINH")]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase __originalMethod)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
			val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction iL) => iL.opcode == OpCodes.Ldc_I4 && (int)iL.operand == 9999)).ThrowIfNotMatch("Didn't find value 9999 in method", (CodeMatch[])(object)new CodeMatch[0]).SetOperandAndAdvance((object)999999);
			return val.InstructionEnumeration();
		}

		[HarmonyPatch(typeof(PostScreen), "OnOpen")]
		[HarmonyPostfix]
		private static void AdjustCurrencyIcon(PostScreen __instance)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			__instance.lbCurrency.transform.GetChild(0).localPosition = new Vector3(-30f, 1f, 0f);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.github.daioutzu.moresparks";

		public const string PLUGIN_NAME = "MoreSparks";

		public const string PLUGIN_VERSION = "1.1.0";
	}
}