From 137a1d948dad5382af169b4660d57e7f31605253 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 20 Oct 2023 20:04:11 +0900 Subject: [PATCH 1/3] Allow interacting with the carousel anywhere in empty space at song select --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 16ae54b413..eb47a7201a 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -1197,6 +1197,8 @@ namespace osu.Game.Screens.Select { private bool rightMouseScrollBlocked; + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + public CarouselScrollContainer() { // size is determined by the carousel itself, due to not all content necessarily being loaded. From 0ae0b0c353618b7289d6fe6b6aac7c34ad9b9886 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 20 Oct 2023 20:04:26 +0900 Subject: [PATCH 2/3] Fix carousel "reset position" marging not scaling with UI scale correctly --- osu.Game/Screens/Select/SongSelect.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index bac84b8134..f792f3e4f5 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -171,11 +171,6 @@ namespace osu.Game.Screens.Select AddRangeInternal(new Drawable[] { - new ResetScrollContainer(() => Carousel.ScrollToSelected()) - { - RelativeSizeAxes = Axes.Y, - Width = 250, - }, new VerticalMaskingContainer { Children = new Drawable[] @@ -243,6 +238,10 @@ namespace osu.Game.Screens.Select Padding = new MarginPadding { Top = left_area_padding }, Children = new Drawable[] { + new ResetScrollContainer(() => Carousel.ScrollToSelected()) + { + RelativeSizeAxes = Axes.Both, + }, beatmapInfoWedge = new BeatmapInfoWedge { Height = WEDGE_HEIGHT, From 127482919329740ef82670e0760c467c1d2e3718 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Oct 2023 14:51:40 +0900 Subject: [PATCH 3/3] Block scroll and click operations on the left side of song select --- osu.Game/Screens/Select/SongSelect.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f792f3e4f5..d5ec94ad71 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -238,7 +238,7 @@ namespace osu.Game.Screens.Select Padding = new MarginPadding { Top = left_area_padding }, Children = new Drawable[] { - new ResetScrollContainer(() => Carousel.ScrollToSelected()) + new LeftSideInteractionContainer(() => Carousel.ScrollToSelected()) { RelativeSizeAxes = Axes.Both, }, @@ -1016,18 +1016,25 @@ namespace osu.Game.Screens.Select } } - private partial class ResetScrollContainer : Container + /// + /// Handles mouse interactions required when moving away from the carousel. + /// + private partial class LeftSideInteractionContainer : Container { - private readonly Action? onHoverAction; + private readonly Action? resetCarouselPosition; - public ResetScrollContainer(Action onHoverAction) + public LeftSideInteractionContainer(Action resetCarouselPosition) { - this.onHoverAction = onHoverAction; + this.resetCarouselPosition = resetCarouselPosition; } + protected override bool OnScroll(ScrollEvent e) => true; + + protected override bool OnMouseDown(MouseDownEvent e) => true; + protected override bool OnHover(HoverEvent e) { - onHoverAction?.Invoke(); + resetCarouselPosition?.Invoke(); return base.OnHover(e); } }