Decompiled source of AzertyControls v1.0.0

AzertyControls.dll

Decompiled 3 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using InControl;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 AzertyControls
{
	[BepInPlugin("com.jeustice.rounds.azertycontrols", "Azerty Controls", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	public class AzertyControls : BaseUnityPlugin
	{
		public const string ModId = "com.jeustice.rounds.azertycontrols";

		public const string ModName = "Azerty Controls";

		public const string Version = "1.0.0";

		internal static ConfigEntry<bool> KeepWASD;

		private void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			KeepWASD = ((BaseUnityPlugin)this).Config.Bind<bool>("Controls", "KeepWASD", true, "Keep the default WASD keys working alongside ZQSD. On AZERTY, W is next to Shift, so turn this off if you hit it by accident.");
			new Harmony("com.jeustice.rounds.azertycontrols").PatchAll();
		}
	}
	[HarmonyPatch(typeof(PlayerActions), "CreateWithKeyboardBindings")]
	internal static class PlayerActions_CreateWithKeyboardBindings
	{
		private static void Postfix(PlayerActions __result)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			if (!AzertyControls.KeepWASD.Value)
			{
				__result.Up.RemoveBinding((BindingSource)new KeyBindingSource((Key[])(object)new Key[1] { (Key)58 }));
				__result.Left.RemoveBinding((BindingSource)new KeyBindingSource((Key[])(object)new Key[1] { (Key)36 }));
			}
			__result.Up.AddDefaultBinding((Key[])(object)new Key[1] { (Key)61 });
			__result.Left.AddDefaultBinding((Key[])(object)new Key[1] { (Key)52 });
		}
	}
}