diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 70260b349e..a3025a65f4 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -84,6 +84,8 @@ namespace osu.Game.Configuration Set(OsuSetting.Version, string.Empty); Set(OsuSetting.ScreenshotFormat, ScreenshotFormat.Jpg); + + Set(OsuSetting.SelectScrollRightClick, false); } public OsuConfigManager(Storage storage) : base(storage) @@ -128,6 +130,7 @@ namespace osu.Game.Configuration ShowConvertedBeatmaps, SpeedChangeVisualisation, Skin, - ScreenshotFormat + ScreenshotFormat, + SelectScrollRightClick } } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 4bbd87c7e6..e8d65a1ed3 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -17,6 +17,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { Children = new Drawable[] { + new SettingsCheckbox + { + LabelText = "Right click to scroll", + Bindable = config.GetBindable(OsuSetting.SelectScrollRightClick), + }, new SettingsCheckbox { LabelText = "Show converted beatmaps", diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 15f4d5cf96..5c3518b46c 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -97,6 +97,9 @@ namespace osu.Game.Screens.Select private readonly Container scrollableContent; + + public Bindable RightClickScrollingEnabled = new Bindable(); + public Bindable RandomAlgorithm = new Bindable(); private readonly List previouslyVisitedRandomSets = new List(); private readonly Stack randomSelectedBeatmaps = new Stack(); @@ -121,6 +124,7 @@ namespace osu.Game.Screens.Select private void load(OsuConfigManager config) { config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm); + config.BindWith(OsuSetting.SelectScrollRightClick, RightClickScrollingEnabled); } public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) @@ -398,6 +402,31 @@ namespace osu.Game.Screens.Select return true; } + private bool rightClickScrolling = false; + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + { + bool result = base.OnMouseDown(state, args); + + if (RightClickScrollingEnabled.Value && !result && args.Button == MouseButton.Right) + { + rightClickScrolling = true; + return true; + } + + return result; + } + + protected override bool OnMouseMove(InputState state) + { + if (state.Mouse.Buttons.Contains(MouseButton.Right) && rightClickScrolling) + ScrollTo((state.Mouse.Position.Y / DrawHeight) * scrollableContent.Height); + else + rightClickScrolling = false; + + return base.OnMouseMove(state); + } + protected override void Update() { base.Update();