Decompiled source of ScrollReverser v1.0.1

BepInEx/plugins/ReverseScrollMod.dll

Decompiled 8 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using ReverseScrollMod.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ReverseScrollMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReverseScrollMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7b7250ca-3cec-499f-9887-48bdb20e43e2")]
[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 ReverseScrollMod
{
	[BepInPlugin("reverse-scroll-plugin-1820", "reverse-scroll", "1.0.0")]
	public class PluginBase : BaseUnityPlugin
	{
		private const string modGuid = "reverse-scroll-plugin-1820";

		private const string modName = "reverse-scroll";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("reverse-scroll-plugin-1820");

		private static PluginBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("reverse-scroll-plugin-1820");
			mls.LogInfo((object)"The mod is awake");
			harmony.PatchAll(typeof(PluginBase));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
		}
	}
}
namespace ReverseScrollMod.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("NextItemSlot")]
		[HarmonyPrefix]
		private static void switchScrollDirectionPatch(ref bool forward)
		{
			forward = !forward;
		}
	}
}