1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-23 22:42:54 +08:00
osu-lazer/osu.Game/Screens/SelectV2
Dean Herbert 024fbde0fd
Refactor selection and activation handling
I had a bit of a struggle getting header traversal logic to work well.
The constraints I had in place were a bit weird:

- Group panels should toggle or potentially fall into the prev/next
  group
- Set panels should just traverse around them

The current method of using `CheckValidForGroupSelection` return type
for traversal did not mesh with the above two cases. Just trust me on
this one since it's quite hard to explain in words.

After some re-thinking, I've gone with a simpler approach with one
important change to UX: Now when group traversing with a beatmap set
header currently keyboard focused, the first operation will be to reset
keyboard selection to the selected beatmap, rather than traverse.

I find this non-offensive – at most it means a user will need to press
their group traversal key one extra time.

I've also changed group headers to always toggle expansion when doing
group traversal with them selected.

To make all this work, the meaning of `Activation` has changed somewhat.
It is now the primary path for carousel implementations to change
selection of an item. It is what the `Drawable` panels call when they
are clicked.

Selection changes are not performed implicitly by `Carousel` – an
implementation should decide when it actually wants to change the
selection, usually in `HandleItemActivated`.

Having less things mutating `CurrentSelection` is better in my eyes, as
we see this variable as only being mutated internally when utmost
required (ie the user has requested the change). With this change,
`CurrentSelection` can no longer become of a non-`T` type (in the
beatmap carousel implementation at least).

This might pave a path forward for making `CurrentSelection` typed, but
that comes with a few other concerns so I'll look at that as a
follow-up.
2025-02-06 17:02:44 +09:00
..
Footer Adjust footer design to display well with the rest of the game 2024-06-30 04:32:05 +03:00
Leaderboards Add context menu option to copy link to an online score 2024-11-04 13:59:48 +01:00
Wedge Inline single-frame layout issue comment instead 2024-08-14 00:41:43 -07:00
BeatmapCarousel.cs Refactor selection and activation handling 2025-02-06 17:02:44 +09:00
BeatmapCarouselFilterGrouping.cs Expose set grouping state 2025-02-06 14:30:15 +09:00
BeatmapCarouselFilterSorting.cs Fix sort direction being flipped 2025-01-23 18:51:24 +09:00
BeatmapInfoWedgeV2.cs Move BeatmapInfoWedgeV2 to correct namespace 2024-12-12 12:53:05 +09:00
BeatmapPanel.cs Refactor selection and activation handling 2025-02-06 17:02:44 +09:00
BeatmapSetPanel.cs Refactor selection and activation handling 2025-02-06 17:02:44 +09:00
Carousel.cs Refactor selection and activation handling 2025-02-06 17:02:44 +09:00
CarouselItem.cs Add tracking of expansion states for groups and sets 2025-02-04 17:51:51 +09:00
GroupPanel.cs Refactor selection and activation handling 2025-02-06 17:02:44 +09:00
ICarouselFilter.cs Add basic selection support 2025-01-11 01:43:47 +09:00
ICarouselPanel.cs Add expanded state to sample drawable representations 2025-02-04 18:06:16 +09:00
SongSelectV2.cs Bind game-wide mods bindable to mod select overlay in new song select screen 2024-06-30 06:50:36 +03:00