Decompiled source of Faster LBoL v1.0.5

FasterLBoL.dll

Decompiled 2 weeks 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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LBoL.Presentation;
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 = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("LBoL.Base")]
[assembly: IgnoresAccessChecksTo("LBoL.ConfigData")]
[assembly: IgnoresAccessChecksTo("LBoL.Core")]
[assembly: IgnoresAccessChecksTo("LBoL.EntityLib")]
[assembly: IgnoresAccessChecksTo("LBoL.Presentation")]
[assembly: IgnoresAccessChecksTo("Untitled.ConfigDataBuilder.Base")]
[assembly: AssemblyCompany("FasterLBoL")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FasterLBoL")]
[assembly: AssemblyTitle("FasterLBoL")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace FasterLBoL
{
	[BepInPlugin("intoxicatedkid.fasterlbol", "Faster LBoL", "1.0.5")]
	[BepInProcess("LBoL.exe")]
	public class BepinexPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(GameMaster), "SetTurboMode")]
		private class GameMaster_SetTurboMode_Patch
		{
			private static bool Prefix(bool turboMode)
			{
				Time.timeScale = (turboMode ? ((float)Math.Min(Math.Max(TurboOn.Value, 1), 1000) / 100f) : ((float)Math.Min(Math.Max(TurboOff.Value, 1), 1000) / 100f));
				return false;
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private class GlobalConfig_get_TurboModeTimeScaleString_Patch
		{
			private static bool Prefix(ref string __result)
			{
				__result = ((float)TurboOn.Value / 100f).ToString("G0");
				return false;
			}
		}

		private static readonly Harmony harmony = PInfo.harmony;

		internal static ManualLogSource log;

		public static ConfigEntry<int> TurboOff;

		public static ConfigEntry<int> TurboOn;

		private void Awake()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_0055: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_0089: Expected O, but got Unknown
			log = ((BaseUnityPlugin)this).Logger;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			TurboOff = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("TurboOff", "TurboOff"), 150, new ConfigDescription("Game speed when Turbo Mode is disabled. Range 1 ~ 1000.", (AcceptableValueBase)null, Array.Empty<object>()));
			TurboOn = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("TurboOn", "TurboOn"), 300, new ConfigDescription("Game speed when Turbo Mode is enabled. Range 1 ~ 1000.", (AcceptableValueBase)null, Array.Empty<object>()));
			harmony.PatchAll();
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public static class PInfo
	{
		public const string GUID = "intoxicatedkid.fasterlbol";

		public const string Name = "Faster LBoL";

		public const string version = "1.0.5";

		public static readonly Harmony harmony = new Harmony("intoxicatedkid.fasterlbol");
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}