Merge branch 'master' into performance-improvements

This commit is contained in:
Dean Herbert 2017-11-13 13:50:57 +09:00 committed by GitHub
commit ee3a5b38f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 7 deletions

View File

@ -3,11 +3,16 @@
using osu.Framework.Timing;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Play.ReplaySettings
{
public class PlaybackSettings : ReplayGroup
{
private const int padding = 10;
protected override string Title => @"playback";
public IAdjustableClock AdjustableClock { set; get; }
@ -16,17 +21,45 @@ public class PlaybackSettings : ReplayGroup
public PlaybackSettings()
{
Child = sliderbar = new ReplaySliderBar<double>
OsuSpriteText multiplierText;
Children = new Drawable[]
{
LabelText = "Playback speed",
Bindable = new BindableDouble(1)
new Container
{
Default = 1,
MinValue = 0.5,
MaxValue = 2,
Precision = 0.01,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = padding },
Children = new Drawable[]
{
new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Text = "Playback speed",
},
multiplierText = new OsuSpriteText
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Text = "1x",
Font = @"Exo2.0-Bold",
}
},
},
sliderbar = new ReplaySliderBar<double>
{
Bindable = new BindableDouble(1)
{
Default = 1,
MinValue = 0.5,
MaxValue = 2,
Precision = 0.01,
},
}
};
sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x";
}
protected override void LoadComplete()