cleaning up unneeded patch

This commit is contained in:
Tyfon
2024-07-03 00:20:11 -07:00
parent d9c9225b2c
commit 981006e047

View File

@@ -26,7 +26,6 @@ namespace UIFixes
new MouseScrollingSpeedPatch().Enable();
new EnhanceHideoutScrollingPatch().Enable();
new EnhanceTaskListScrollingPatch().Enable();
new RememberTaskListScrollPositionPatch().Enable();
new OpenLastTaskPatch().Enable();
}
@@ -336,30 +335,6 @@ namespace UIFixes
}
}
public class RememberTaskListScrollPositionPatch : ModulePatch
{
private static float ScrollPosition = 1f;
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(TasksScreen), nameof(TasksScreen.Show));
}
[PatchPostfix]
public static void Postfix(TasksScreen __instance, ScrollRect ____scrollRect)
{
____scrollRect.verticalNormalizedPosition = ScrollPosition;
____scrollRect.onValueChanged.AddListener(UpdateScrollPosition);
__instance.R().UI.AddDisposable(() => ____scrollRect.onValueChanged.RemoveListener(UpdateScrollPosition));
}
private static void UpdateScrollPosition(Vector2 position)
{
ScrollPosition = position.y;
}
}
public class OpenLastTaskPatch : ModulePatch
{
private static string LastQuestId = null;