Skip to content
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

Split out beatmap and set panels in beatmap carousel v2 #31652

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

peppy
Copy link
Member

@peppy peppy commented Jan 24, 2025

In preparation for getting grouping working, let's do sets/beatmaps "properly".

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check test failure fix attempt in b0136f9.

Comment on lines +660 to +662
carouselPanel.Item = null;
carouselPanel.Selected.Value = false;
carouselPanel.KeyboardSelected.Value = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the significance of these operations? Should I be worrying that CarouselYPosition isn't reset here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just see it as sane defaults for animation purposes. ie. new panel comes alive, if it gets selected i'd hope it goes from not-selected to selected, rather than starting with selected==true.

Should I be worrying that CarouselYPosition isn't reset here?

I assume you mean DrawYPosition? I don't know what a sane default for that would be. We could set it back to 0 but I think it's kinda up to carousel to manage that (it already transfers when retrieving from pool immediately)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that you moved this logic from BeatmapPanel.FreeAfterUse() which I guess gives this change more of a point. I can agree with it in that light.

osu.Game/Screens/SelectV2/BeatmapSetPanel.cs Outdated Show resolved Hide resolved

protected override bool OnClick(ClickEvent e)
{
carousel.CurrentSelection = Item!.Model;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To continue the theme above, this weirds me out. Locally the set panel select itself but then that gets hijacked to beatmap selection at Carousel level? It's a bit strange, is it supposed to be like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too sure. How would you see it working? I'm trying to keep the knowlege of "what selects what" all in one place (BeatmapCarousel) and keep these panels as simple as possible. The other direction would be to make them very self aware.

For this specific case I guess it can already do that by setting its first available beatmap, which sounds fine and maybe preferable, until we add something like a recommendation step to the process. Once we have an external entity choosing which beatmap should be selected, I think it's going to be better to have this selection logic in BeatmapCarousel.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno... maybe at least an inline comment or something that this gets magically handled elsewhere?

The other suggestion would be to invert the flow and just give panels a delegate to request selection from the carousel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold that though until I get groups working, because selection is a bit obtuse there and i'm still finding a solution.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll get back to this later then... if I remember to I guess 😅

@peppy
Copy link
Member Author

peppy commented Jan 24, 2025

Please check test failure fix attempt in b0136f9.

Looks good 👍

@bdach bdach enabled auto-merge January 24, 2025 14:17
@bdach bdach merged commit 3c76397 into ppy:master Jan 24, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants