mirror of
https://github.com/ppy/osu
synced 2025-01-22 05:43:14 +00:00
Merge pull request #1491 from EVAST9919/replay-setting-visual
Replay speed setting visual improvements
This commit is contained in:
commit
9056f2d978
@ -3,11 +3,16 @@
|
|||||||
|
|
||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.ReplaySettings
|
namespace osu.Game.Screens.Play.ReplaySettings
|
||||||
{
|
{
|
||||||
public class PlaybackSettings : ReplayGroup
|
public class PlaybackSettings : ReplayGroup
|
||||||
{
|
{
|
||||||
|
private const int padding = 10;
|
||||||
|
|
||||||
protected override string Title => @"playback";
|
protected override string Title => @"playback";
|
||||||
|
|
||||||
public IAdjustableClock AdjustableClock { set; get; }
|
public IAdjustableClock AdjustableClock { set; get; }
|
||||||
@ -16,17 +21,45 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
|
|
||||||
public PlaybackSettings()
|
public PlaybackSettings()
|
||||||
{
|
{
|
||||||
Child = sliderbar = new ReplaySliderBar<double>
|
OsuSpriteText multiplierText;
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
LabelText = "Playback speed",
|
new Container
|
||||||
Bindable = new BindableDouble(1)
|
|
||||||
{
|
{
|
||||||
Default = 1,
|
RelativeSizeAxes = Axes.X,
|
||||||
MinValue = 0.5,
|
AutoSizeAxes = Axes.Y,
|
||||||
MaxValue = 2,
|
Padding = new MarginPadding { Horizontal = padding },
|
||||||
Precision = 0.01,
|
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()
|
protected override void LoadComplete()
|
||||||
|
Loading…
Reference in New Issue
Block a user