Apply scroll speed to lightscrollers

This commit is contained in:
Tyfon
2024-07-21 14:06:30 -07:00
parent 328eedbc89
commit 575e33f04a

View File

@@ -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()