-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make beatmap carousel select nearest to selection when selection was filtered #20912
Conversation
…form-selection
…form-selection � Conflicts: � osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs
@LittleEndu I've rewritten the main method here to avoid using LINQ, mostly because the logic you had in the LINQ was basically duplicating the non-LINQ logic for the edge case scenarios. I think this looks good otherwise, but please check my implementation to make sure I haven't (well, the tests haven't) overlooked anything. |
Looks good to me. |
This comment was marked as outdated.
This comment was marked as outdated.
Real failure seems to be that during testing/debugging, carousel root sometimes skips eager selection, and then |
return null; | ||
|
||
int forwardsIndex = lastSelectedIndex; | ||
int backwardsIndex = lastSelectedIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int backwardsIndex = lastSelectedIndex; | |
int backwardsIndex = lastSelectedIndex == Items.Count ? Items.Count - 1 : lastSelectedIndex; |
This PR changes carousel behaviour when currently selected beatmap gets filtered. Right now the selection is random, this PR would change that to be nearest to previous selection. This PR is basically previous PR but tests fixed.
Changes
BeatmapCarousel
usePerformSelection
when previous selection was filtered (instead ofSelectNextRandom
)CarouselGroupEagerSelect
perform selection in both direction, selecting nearest to previous selection (instead of only selecting forwards)