Merge remote-tracking branch 'upstream/master' into peppy-improve-volume-controls

This commit is contained in:
Dean Herbert
2018-06-13 16:14:20 +09:00
163 changed files with 2421 additions and 1905 deletions

View File

@ -168,9 +168,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)
{