using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.InputSystem;
using WheelUp.patches;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TestMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestMod")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1fa35a2c-dff5-4f33-a5d4-4cf939e79006")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace WheelUp
{
[BepInPlugin("Shrootato.WheelUp", "WHeel Up", "1.0.0")]
public class WheelUpBase : BaseUnityPlugin
{
private const string modGUID = "Shrootato.WheelUp";
private const string modName = "WHeel Up";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Shrootato.WheelUp");
private static WheelUpBase Instance;
public static ManualLogSource log;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
log = Logger.CreateLogSource("Shrootato.WheelUp");
log.LogInfo((object)"Starting WHeel Up");
harmony.PatchAll(typeof(WheelUpPatch));
}
}
}
namespace WheelUp.patches
{
internal class WheelUpPatch
{
[HarmonyPatch(typeof(IngamePlayerSettings), "RebindKey")]
public class AllowMouseBindings
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codes)
{
return codes.Where(delegate(CodeInstruction code)
{
bool flag = code.opcode == OpCodes.Ldstr && CodeInstructionExtensions.OperandIs(code, (object)"Mouse");
bool flag2 = CodeInstructionExtensions.Calls(code, typeof(RebindingOperation).GetMethod("WithControlsExcluding"));
return !flag && !flag2;
});
}
}
}
}