This commit is contained in:
Tyfon
2024-06-15 18:09:05 -07:00
parent 05a646b82f
commit 29e352eee9
3 changed files with 6 additions and 6 deletions

View File

@@ -88,8 +88,8 @@ namespace UIFixes
____searchInputField.text = lastSearch;
}
ScrollPatches.KeyScroller scroller = __instance.GetComponentInParent<ScrollPatches.KeyScroller>();
scroller?.OnKeyScroll.AddListener(ClearLastScrollPosition);
ScrollPatches.KeyScrollListener listener = __instance.GetComponentInParent<ScrollPatches.KeyScrollListener>();
listener?.OnKeyScroll.AddListener(ClearLastScrollPosition);
}
[PatchPostfix]
@@ -169,7 +169,7 @@ namespace UIFixes
LastAbsoluteDownScrollPosition = (1f - scrollRect.verticalNormalizedPosition) * (scrollRect.content.rect.height - scrollRect.viewport.rect.height);
}
scrollRect.GetComponent<ScrollPatches.KeyScroller>()?.OnKeyScroll.RemoveListener(ClearLastScrollPosition);
scrollRect.GetComponent<ScrollPatches.KeyScrollListener>()?.OnKeyScroll.RemoveListener(ClearLastScrollPosition);
}
// Reset the default behavior

View File

@@ -194,7 +194,7 @@ namespace UIFixes
Item targetItem = __instance.method_8(targetItemContext);
// baby steps: bail if no targetItem for now
// TODO: Handle dropping in a grid. Bail if no targetItem for now
if (targetItem == null)
{
return false;

View File

@@ -146,7 +146,7 @@ namespace UIFixes
}
}
public class KeyScroller : MonoBehaviour
public class KeyScrollListener : MonoBehaviour
{
private ScrollRect scrollRect;
@@ -259,7 +259,7 @@ namespace UIFixes
return;
}
scrollRect.GetOrAddComponent<KeyScroller>();
scrollRect.GetOrAddComponent<KeyScrollListener>();
}
}