mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +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.RandomSelectAlgorithm, RandomAlgorithm);
|
||||||
config.BindWith(OsuSetting.SelectScrollRightClick, RightClickScrollingEnabled);
|
config.BindWith(OsuSetting.SelectScrollRightClick, RightClickScrollingEnabled);
|
||||||
|
|
||||||
|
RightClickScrollingEnabled.ValueChanged += v => RightMouseScrollbar = v;
|
||||||
|
RightClickScrollingEnabled.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
|
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
|
||||||
@ -402,31 +405,6 @@ namespace osu.Game.Screens.Select
|
|||||||
return true;
|
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()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
Loading…
Reference in New Issue
Block a user