mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Merge remote-tracking branch 'upstream/master' into DrabWeb-beatmap-set-downloader
This commit is contained in:
commit
803598c3d0
@ -167,9 +167,25 @@ namespace osu.Game.Overlays.Volume
|
||||
private set => Bindable.Value = value;
|
||||
}
|
||||
|
||||
public void Increase() => Volume += 0.05f;
|
||||
private const float adjust_step = 0.05f;
|
||||
|
||||
public void Decrease() => Volume -= 0.05f;
|
||||
public void Increase() => adjust(1);
|
||||
public void Decrease() => adjust(-1);
|
||||
|
||||
private void adjust(int direction)
|
||||
{
|
||||
float amount = adjust_step * direction;
|
||||
|
||||
var mouse = GetContainingInputManager().CurrentState.Mouse;
|
||||
if (mouse.HasPreciseScroll)
|
||||
{
|
||||
float scrollDelta = mouse.ScrollDelta.Y;
|
||||
if (scrollDelta != 0)
|
||||
amount *= Math.Abs(scrollDelta / 10);
|
||||
}
|
||||
|
||||
Volume += amount;
|
||||
}
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user