fix scroller in freeplay role menu

This commit is contained in:
XtraCube committed 2025-04-05 15:00:35 -04:00
1 parent 30516104aa
commit 3fabe85a18
1 file changed
+3 -3
+3 -3
View File
@@ -18,7 +18,7 @@ namespace MiraAPI.Patches.Freeplay;
[HarmonyPatch(typeof(TaskAdderGame))]
internal static class TaskAdderPatches
{
private static Scroller? _scroller;
private static Scroller _scroller = null!;
[HarmonyPostfix]
[HarmonyPatch(nameof(TaskAdderGame.Begin))]
@@ -293,9 +293,9 @@ internal static class TaskAdderPatches
chip.GetComponent<SpriteRenderer>().maskInteraction = SpriteMaskInteraction.VisibleInsideMask;
}
if (_scroller && _scroller != null)
if (_scroller)
{
_scroller.CalculateAndSetYBounds(__instance.ActiveItems.Count, 6, 3, 1f);
_scroller.CalculateAndSetYBounds(__instance.ActiveItems.Count, 6, 5, 1.4f);
_scroller.SetYBoundsMin(0.0f);
_scroller.ScrollToTop();
}