From 575e33f04a0fa9d244d08dc84a5b95bdd73d37fa Mon Sep 17 00:00:00 2001 From: Tyfon <29051038+tyfon7@users.noreply.github.com> Date: Sun, 21 Jul 2024 14:06:30 -0700 Subject: [PATCH] Apply scroll speed to lightscrollers --- Patches/ScrollPatches.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Patches/ScrollPatches.cs b/Patches/ScrollPatches.cs index e523b35..9ea6d43 100644 --- a/Patches/ScrollPatches.cs +++ b/Patches/ScrollPatches.cs @@ -23,7 +23,10 @@ public static class ScrollPatches new EnchanceTraderStashScrollingPatch().Enable(); new EnhanceFleaScrollingPatch().Enable(); new EnhanceMailScrollingPatch().Enable(); + new MouseScrollingSpeedPatch().Enable(); + new LightScrollerSpeedPatch().Enable(); + new EnhanceHideoutScrollingPatch().Enable(); new EnhanceTaskListScrollingPatch().Enable(); new OpenLastTaskPatch().Enable(); @@ -305,6 +308,21 @@ public static class ScrollPatches } } + public class LightScrollerSpeedPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return AccessTools.Method(typeof(LightScroller), nameof(LightScroller.method_1)); + } + + [PatchPrefix] + public static void Prefix(ref float deltaPixels) + { + int multi = Settings.UseRaidMouseScrollMulti.Value && Plugin.InRaid() ? Settings.MouseScrollMultiInRaid.Value : Settings.MouseScrollMulti.Value; + deltaPixels *= multi; + } + } + public class EnhanceTaskListScrollingPatch : ModulePatch { protected override MethodBase GetTargetMethod()