mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:52:56 +08:00
Use the already existent RightMouseScrollbar field
This commit is contained in:
parent
e3cd0ef200
commit
1a2b1d4c98
@ -125,6 +125,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm);
|
||||
config.BindWith(OsuSetting.SelectScrollRightClick, RightClickScrollingEnabled);
|
||||
|
||||
RightClickScrollingEnabled.ValueChanged += v => RightMouseScrollbar = v;
|
||||
RightClickScrollingEnabled.TriggerChange();
|
||||
}
|
||||
|
||||
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||
@ -402,31 +405,6 @@ 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();
|
||||
|
Loading…
Reference in New Issue
Block a user