Decompiled source of KeyRepeatAdjust v1.0.0

plugins/KeyRepeatAdjust/KeyRepeatAdjust.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.NET.Common;
using BepInExResoniteShim;
using BepisResoniteWrapper;
using FrooxEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")]
[assembly: AssemblyCompany("art0007i")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2834c72c128bb8def5fed993d26dd53921b8e8e3")]
[assembly: AssemblyProduct("KeyRepeatAdjust")]
[assembly: AssemblyTitle("KeyRepeatAdjust")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/art0007i/KeyRepeatAdjust")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace KeyRepeatAdjust;

[ResonitePlugin("art0007i.KeyRepeatAdjust", "KeyRepeatAdjust", "1.0.0", "art0007i", "https://github.com/art0007i/KeyRepeatAdjust")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BasePlugin
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Action <>9__3_0;

		public static EventHandler <>9__3_1;

		public static EventHandler <>9__3_2;

		internal void <Load>b__3_0()
		{
			Engine.Current.InputInterface.KeyRepeatWait = RepeatDelay.Value;
			Engine.Current.InputInterface.KeyRepeatInterval = 1f / RepeatInterval.Value;
		}

		internal void <Load>b__3_1(object? _, EventArgs _)
		{
			Engine.Current.InputInterface.KeyRepeatWait = RepeatDelay.Value;
		}

		internal void <Load>b__3_2(object? _, EventArgs _)
		{
			Engine.Current.InputInterface.KeyRepeatInterval = 1f / RepeatInterval.Value;
		}
	}

	internal static ManualLogSource Log;

	internal static ConfigEntry<float> RepeatDelay;

	internal static ConfigEntry<float> RepeatInterval;

	public override void Load()
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Expected O, but got Unknown
		//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)
		//IL_009b: Expected O, but got Unknown
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Expected O, but got Unknown
		Log = ((BasePlugin)this).Log;
		RepeatDelay = ((BasePlugin)this).Config.Bind<float>("General", "RepeatDelay", 0.25f, "Amount of time in seconds before a key will be automatically pressed while holding it.");
		RepeatInterval = ((BasePlugin)this).Config.Bind<float>("General", "RepeatInterval", 30f, "Amount of presses per second that will be performed while holding a key.");
		object obj = <>c.<>9__3_0;
		if (obj == null)
		{
			Action val = delegate
			{
				Engine.Current.InputInterface.KeyRepeatWait = RepeatDelay.Value;
				Engine.Current.InputInterface.KeyRepeatInterval = 1f / RepeatInterval.Value;
			};
			<>c.<>9__3_0 = val;
			obj = (object)val;
		}
		ResoniteHooks.OnEngineReady += (Action)obj;
		ConfigEntry<float> repeatDelay = RepeatDelay;
		object obj2 = <>c.<>9__3_1;
		if (obj2 == null)
		{
			EventHandler val2 = delegate
			{
				Engine.Current.InputInterface.KeyRepeatWait = RepeatDelay.Value;
			};
			<>c.<>9__3_1 = val2;
			obj2 = (object)val2;
		}
		repeatDelay.SettingChanged += (EventHandler)obj2;
		ConfigEntry<float> repeatDelay2 = RepeatDelay;
		object obj3 = <>c.<>9__3_2;
		if (obj3 == null)
		{
			EventHandler val3 = delegate
			{
				Engine.Current.InputInterface.KeyRepeatInterval = 1f / RepeatInterval.Value;
			};
			<>c.<>9__3_2 = val3;
			obj3 = (object)val3;
		}
		repeatDelay2.SettingChanged += (EventHandler)obj3;
	}
}
public static class PluginMetadata
{
	public const string GUID = "art0007i.KeyRepeatAdjust";

	public const string NAME = "KeyRepeatAdjust";

	public const string VERSION = "1.0.0";

	public const string AUTHORS = "art0007i";

	public const string REPOSITORY_URL = "https://github.com/art0007i/KeyRepeatAdjust";
}