cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user