1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-09 02:24:10 +08:00

Merge pull request #8205 from peppy/always-scroll-to-selection

Fix changing ruleset at song select not scrolling the current selection back into view
This commit is contained in:
Dan Balasescu 2020-03-11 14:38:57 +09:00 committed by GitHub
commit e6685c88fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,7 +189,7 @@ namespace osu.Game.Screens.Select
root.AddChild(newSet); root.AddChild(newSet);
applyActiveCriteria(false, false); applyActiveCriteria(false);
//check if we can/need to maintain our current selection. //check if we can/need to maintain our current selection.
if (previouslySelectedID != null) if (previouslySelectedID != null)
@ -239,7 +239,7 @@ namespace osu.Game.Screens.Select
{ {
Debug.Assert(bypassFilters); Debug.Assert(bypassFilters);
applyActiveCriteria(false, true); applyActiveCriteria(false);
} }
return true; return true;
@ -396,7 +396,7 @@ namespace osu.Game.Screens.Select
{ {
if (PendingFilter?.Completed == false) if (PendingFilter?.Completed == false)
{ {
applyActiveCriteria(false, false); applyActiveCriteria(false);
Update(); Update();
} }
} }
@ -406,10 +406,10 @@ namespace osu.Game.Screens.Select
if (newCriteria != null) if (newCriteria != null)
activeCriteria = newCriteria; activeCriteria = newCriteria;
applyActiveCriteria(debounce, true); applyActiveCriteria(debounce);
} }
private void applyActiveCriteria(bool debounce, bool scroll) private void applyActiveCriteria(bool debounce)
{ {
if (root.Children.Any() != true) return; if (root.Children.Any() != true) return;
@ -419,7 +419,7 @@ namespace osu.Game.Screens.Select
root.Filter(activeCriteria); root.Filter(activeCriteria);
itemsCache.Invalidate(); itemsCache.Invalidate();
if (scroll) scrollPositionCache.Invalidate(); scrollPositionCache.Invalidate();
} }
PendingFilter?.Cancel(); PendingFilter?.Cancel();