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