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

View File

@@ -194,7 +194,7 @@ namespace UIFixes
Item targetItem = __instance.method_8(targetItemContext); 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) if (targetItem == null)
{ {
return false; return false;

View File

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