Future-proofing swappatch, add mouse scroll multi

This commit is contained in:
Tyfon
2024-04-24 14:50:21 -07:00
parent 59c2428595
commit 20ca007969
4 changed files with 107 additions and 34 deletions

View File

@@ -21,6 +21,7 @@ namespace UIFixes
new TraderDealScreenPatch().Enable();
new OfferViewListPatch().Enable();
new MessagesContainerPatch().Enable();
new MouseScrollSpeedPatch().Enable();
}
protected static void HandleInput(ScrollRect scrollRect)
@@ -229,5 +230,20 @@ namespace UIFixes
return instructions;
}
}
public class MouseScrollSpeedPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
Type type = typeof(ScrollRectNoDrag);
return type.GetMethod("OnScroll");
}
[PatchPrefix]
private static void Prefix(PointerEventData data)
{
data.scrollDelta *= Settings.MouseScrollMulti.Value;
}
}
}
}