Merge branch 'master' into osu-fontusage

This commit is contained in:
Dean Herbert
2019-02-22 18:09:23 +09:00
committed by GitHub
286 changed files with 837 additions and 876 deletions

View File

@ -4,7 +4,7 @@
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
@ -157,12 +157,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected override void LoadComplete()
{
base.LoadComplete();
beatDivisor.ValueChanged += v => updateText();
updateText();
beatDivisor.BindValueChanged(val => Text = $"1/{val.NewValue}", true);
}
private void updateText() => Text = $"1/{beatDivisor.Value}";
}
private class DivisorButton : IconButton
@ -219,9 +215,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
AddInternal(marker = new Marker());
CurrentNumber.ValueChanged += v =>
CurrentNumber.ValueChanged += div =>
{
marker.MoveToX(getMappedPosition(v), 100, Easing.OutQuint);
marker.MoveToX(getMappedPosition(div.NewValue), 100, Easing.OutQuint);
marker.Flash();
};
}
@ -238,11 +234,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
case Key.Right:
beatDivisor.Next();
OnUserChange(Current);
OnUserChange(Current.Value);
return true;
case Key.Left:
beatDivisor.Previous();
OnUserChange(Current);
OnUserChange(Current.Value);
return true;
default:
return false;
@ -279,7 +275,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
var xPosition = (ToLocalSpace(screenSpaceMousePosition).X - RangePadding) / UsableWidth;
CurrentNumber.Value = availableDivisors.OrderBy(d => Math.Abs(getMappedPosition(d) - xPosition)).First();
OnUserChange(Current);
OnUserChange(Current.Value);
}
private float getMappedPosition(float divisor) => (float)Math.Pow((divisor - 1) / (availableDivisors.Last() - 1), 0.90f);